Skip to Content
Menu
This question has been flagged
1 Odpoveď
795 Zobrazenia

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?

Avatar
Zrušiť
Best Answer

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

Avatar
Zrušiť
Related Posts Replies Zobrazenia Aktivita
1
nov 24
1030
2
sep 24
778
4
sep 24
895
0
aug 24
1074
1
aug 24
776