Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
4871 Widoki

hi, can anybody help me with this situation

i want to disable clicking the customer button in pos screen and payment screen

disable clicking on it only not remove it, but keep it showing the customer selected via RFID card

Awatar
Odrzuć
Autor

unfortunately, is not working in odoo 15

my manifest , and the code you wrote

{
"name": "Point of Sale - Disable Buttons",
"version": "15.0.1.0.1",
"category": "Point Of Sale",
"summary": "Disable Buttons in the PoS",
'author': 'Dev Solutions',
'website': 'https://local.dev',
'depends': ['base', 'point_of_sale'],
'assets': {
'web.assets_qweb': [
'pos_disable_buttons/static/src/xml/Customer.xml',
],
},
'license': 'LGPL-3',
'installable': True,
'auto_install': False,
'application': False,
}

Najlepsza odpowiedź

Hi 

Please try this code,

<?xml version="1.0" encoding="UTF-8"?>


<templates id="template" xml:space="preserve">


        <t t-name="Customer" t-inherit="point_of_sale.ActionpadWidget" t-inherit-mode="extension" owl="1">


        <xpath expr="//div//button" position="replace">


            <t t-if="">


            <button class="disabled-mode mode-button button set-partner">Customer</button>


       </t>


            <t t-else="">


                <button class="button set-partner disabled-mode" t-att-class="{'decentered': isLongName}"


                        t-on-click="() => this.trigger('click-partner')">


                    <t t-if="!env.isMobile"><i class="fa fa-user" role="img" aria-label="Customer" title="Customer" /></t>


                    <t t-if="props.partner">


                        <t t-esc="props.partner.name" />


                    </t>


                    <t t-else="">


                        Customer


                    </t>


                </button>


            </t>


        </xpath>


    </t>


</templates>

 

By using your condition in the t-if statement, here I disabled the customer button in the payment screen as same as we can disable the customer button by extending the PaymentScreen,

Regards

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
paź 24
1111
1
wrz 24
1882
1
mar 15
4588
1
lut 22
1440
1
sty 22
2401