diff --git a/__manifest__.py b/__manifest__.py index 6576bcfc0bfa586ae978043bdf6e93c3573fba96..b08b97652cb1c06d44f7ba84aede2ca16a24a8c7 100644 --- a/__manifest__.py +++ b/__manifest__.py @@ -1,7 +1,7 @@ { "name": "VRACOOP - POS Balance Container QRCode", "summary": "VRACOOP - POS Balance Container QRCode", - "version": "12.0.1.7.0", + "version": "12.0.1.8.0", "development_status": "Beta", "author": "Le Filament", "maintainers": ["remi-filament"], diff --git a/static/src/js/container.js b/static/src/js/container.js index 8dc3ceec0cf98179136d16a9b15ae0a2891c07d5..9cb6e15a121c0ccd97a330d2161df3f3c76a3fe5 100644 --- a/static/src/js/container.js +++ b/static/src/js/container.js @@ -29,7 +29,7 @@ odoo.define('vracoop_pos_container_qrcode.container_print_qr', function (require init: function(parent, options){ this._super(parent, options); - this.barcode_base64; + this.barcode_base64 = false; }, show: function(){ @@ -54,7 +54,6 @@ odoo.define('vracoop_pos_container_qrcode.container_print_qr', function (require else { count_it = 0; if (self.weight > 0){ - self.create_container(); self.print(); self.gui.show_screen('confirmation'); } @@ -91,7 +90,7 @@ odoo.define('vracoop_pos_container_qrcode.container_print_qr', function (require ///////////////////////////// handle_auto_print: function() { - this.create_container(); + // this.create_container(); this.print(); this.click_next(); }, @@ -112,7 +111,6 @@ odoo.define('vracoop_pos_container_qrcode.container_print_qr', function (require var categ_container = this.pos.config.categ_container; var timestamp = Math.floor((new Date().getTime())/1000); -// var weight_str = (this.weight * 1000).toString(); var weight_str = parseInt(this.weight * 1000, 10); weight_str = ("0000" + weight_str).slice(-4); @@ -130,12 +128,14 @@ odoo.define('vracoop_pos_container_qrcode.container_print_qr', function (require var second_int = parseInt(ean20.substring(10,21)); var cle_int = parseInt(ean20.substr(-1)); -// Conversion bae 36 +// Conversion base 36 var base36_first = first_int.toString(36); var base36_second = second_int.toString(36); var base36_cle = cle_int.toString(36); - var url_qrcode = url_qr.concat(base36_cle,'-',base36_first,'-',base36_second); + this.barcode_base64 = base36_cle.concat('-',base36_first,'-',base36_second); + var url_qrcode = url_qr.concat(this.barcode_base64); + var weight_gr = parseInt(weight_str, 10) + 'g' return { widget: this, @@ -151,7 +151,7 @@ odoo.define('vracoop_pos_container_qrcode.container_print_qr', function (require this._super(); this.$('.next,.print-qrcode').click(function(){ - self.create_container(); + // self.create_container(); self.print(); }); }, @@ -177,8 +177,8 @@ odoo.define('vracoop_pos_container_qrcode.container_print_qr', function (require print_xml: function() { var receipt = QWeb.render('XmlQR', this.get_receipt_render_env()); + this.create_container(); this.pos.proxy.print_receipt(receipt); - }, print: function() { @@ -206,6 +206,7 @@ odoo.define('vracoop_pos_container_qrcode.container_print_qr', function (require }, render_receipt: function() { this.$('.pos-qr-container').html(QWeb.render('PosQR', this.get_receipt_render_env())); + this.create_container(); }, create_container: function(){ var self = this; @@ -213,7 +214,7 @@ odoo.define('vracoop_pos_container_qrcode.container_print_qr', function (require fields['weight'] = this.weight; - fields.barcode = false; + fields.barcode = this.barcode_base64; fields.name = _t('Container'); this.pos.push_container(fields);