Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
4827 Vizualizări

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

Imagine profil
Abandonează
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,
}

Cel mai bun răspuns

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

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
oct. 24
1083
1
sept. 24
1854
1
mar. 15
4549
1
feb. 22
1407
1
ian. 22
2373