Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
4795 Näkymät

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

Avatar
Hylkää
Tekijä

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

Paras vastaus

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

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
0
lokak. 24
1056
1
syysk. 24
1829
1
maalisk. 15
4528
1
helmik. 22
1386
1
tammik. 22
2355