Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
4 Risposte
13050 Visualizzazioni

<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();

},

});

Avatar
Abbandona

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.

Risposta migliore

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

Avatar
Abbandona
Autore

Thanks for help..!!

Risposta migliore

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();

                 }

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
set 20
38
1
nov 24
1470
4
ott 24
3773
4
mar 24
2910
2
giu 23
3247