Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
1454 Lượt xem

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?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 11 24
1862
2
thg 9 24
1439
Odoo apps module Đã xử lý
4
thg 9 24
2108
0
thg 8 24
1824
1
thg 8 24
1444