콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
794 화면

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

아바타
취소
관련 게시물 답글 화면 활동
1
11월 24
1026
2
9월 24
778
Odoo apps module 해결 완료
4
9월 24
894
0
8월 24
1073
1
8월 24
776