Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
4 Răspunsuri
12882 Vizualizări

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

},

});

Imagine profil
Abandonează

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.

Cel mai bun răspuns

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

Imagine profil
Abandonează
Autor

Thanks for help..!!

Cel mai bun răspuns

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

                 }

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
sept. 20
38
1
nov. 24
1113
4
oct. 24
3336
4
mar. 24
2721
2
iun. 23
3077