diff --git a/static/src/js/container.js b/static/src/js/container.js index 467d679..c0a61a8 100644 --- a/static/src/js/container.js +++ b/static/src/js/container.js @@ -328,17 +328,20 @@ odoo.define('vracoop_pos_free_balance_v2.container_balance', function (require) return this.pos.get_container_product(); }, create_container: function(){ - var self = this; - var fields = {}; + + if (this.weight != 0) { + var self = this; + var fields = {}; - fields['weight'] = this.weight; + fields['weight'] = this.weight; - fields.barcode = this.gui.get_current_screen_param('barcode') || false; - fields.name = fields.name || _t('Container'); + fields.barcode = this.gui.get_current_screen_param('barcode') || false; + fields.name = fields.name || _t('Container'); - this.pos.push_container(fields).then( - this.pushed_container(fields["barcode"],fields) - ); + this.pos.push_container(fields).then( + this.pushed_container(fields["barcode"],fields) + ); + } }, pushed_container: function(barcode,container){ var self = this; @@ -381,12 +384,12 @@ odoo.define('vracoop_pos_free_balance_v2.container_balance', function (require) // this.set_price(0); scale_screen.renderElement(); - queue.schedule(function () { - return self.pos.proxy.reset_weight().then(function () { - self.set_weight(0); - // self.set_price(0); - }); - }, {duration: 500}); + // queue.schedule(function () { + // return self.pos.proxy.reset_weight().then(function () { + // self.set_weight(0); + // // self.set_price(0); + // }); + // }, {duration: 500}); queue.schedule(function(){ return self.pos.proxy.scale_read().then(function(scale_answer){