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

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

    <t t-name="CreatSaleOrder">

        <div class="row">

            <button id="sale_order_button" >

                <i class="fa fa-shopping-cart pos-so-cart"/>

                <p>Create Sale Order</p>

            </button>

        </div>

    </t>

</template>

--- here is my js code ----


screens.NumpadWidget.include({

    changedMode: function() {

    var self = this;

               if (self.pos.config.so_option) {

                    $('#sale_order_button').('show');

                } else {

                     $('#sale_order_button').('hide');

                 }

    self._super();

},

});

อวตาร
ละทิ้ง

Where do you need to add that button in "actionpad" or "numpad"? so inherit appropriate template and add button then you could try in JavaScript.

คำตอบที่ดีที่สุด

Update

You could try like this,

<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
    <t t-name="CreateSaleOrder">
        <div class='control-button sale_order_button'>
            <i class='fa fa-shopping-cart pos-so-cart' /> Create Sale Order
        </div>
    </t>
</templates>
var CreateSaleOrder = screens.ActionButtonWidget.extend({
template: 'CreateSaleOrder',
    //your codes here
});
screens.define_action_button({
'name': 'createsaleorder',
'widget': CreateSaleOrder,
'condition': function(){
return this.pos.config.so_option;
},
});

or this post will help you https://stackoverflow.com/questions/41997252/odoo-10-add-button-to-pos

อวตาร
ละทิ้ง
ผู้เขียน

Thanks for help..!!

คำตอบที่ดีที่สุด

Hi, veerali shah

here we are using jquery to hide() and show() the button

if you using id please use '#' infront of name and if you use class name please use '.'

if (self.pos.config.so_option) {

                    $('#sale_order_button').show();

                } else {

                     $('#sale_order_button').hide();

                 }

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ก.ย. 20
38
1
พ.ย. 24
1473
4
ต.ค. 24
3779
4
มี.ค. 24
2927
2
มิ.ย. 23
3252