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

Hello everyone, I have a question. I’m facing an issue while developing a module for the POS application. I’m working on implementing "POS Delivery Charges," but in the pos_config_view file, I’m unable to pinpoint the correct template to modify. Here’s the code I'm working with: 
<odoo>

    <data>

        <record id="view_pos_config_form_inherit" model="ir.ui.view">

            <field name="name">pos.config.form.inherit</field>

            <field name="model">pos.config</field>

            <field name="inherit_id" ref="point_of_sale.ProductScreen"/>

            <field name="arch" type="xml">

                <xpath expr="//div[@class='pads border-top']" position="inside">

                    <setting string="Delivery Charges" help="Enable delivery charges for the PoS.">

                        <field name="enable_delivery_charges"/>

                    </setting>

                </xpath>

            </field>

        </record>

    </data>

</odoo>

I'm struggling to resolve the issue of adding a button to activate the desired functionality in the module. Can anyone assist?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

Create the XML Template

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

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

    <t t-name="CustomControlButton" owl="1">

        <div class="control-button btn btn-light rounded-0 fw-bolder"

             t-on-click="onClick">

            <span>Custom Button</span>

        </div>

    </t>

</templates>

Create the JavaScript File

        },

    position: ['after', 'OrderlineCustomerNoteButton'],

});


'assets': {

    'point_of_sale._assets_pos': [

        'your_module/static/src/js/custom_control_button.js',

        'your_module/static/src/xml/custom_control_button.xml',

    ],

},


Hope it helps

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ย. 24
1558
2
ก.ย. 24
1237
Odoo apps module แก้ไขแล้ว
4
ก.ย. 24
1707
0
ส.ค. 24
1612
1
ส.ค. 24
1240