Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
4853 Переглядів

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

Аватар
Відмінити
Автор

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,
}

Найкраща відповідь

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

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
0
жовт. 24
1101
1
вер. 24
1872
1
бер. 15
4579
1
лют. 22
1421
1
січ. 22
2388