Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
4861 มุมมอง

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
1105
1
ก.ย. 24
1875
1
มี.ค. 15
4582
1
ก.พ. 22
1426
1
ม.ค. 22
2389