Browse Source

[FIX]Probleme de tare envoyée a la balance

12-V2.0
Juliana 3 years ago
parent
commit
076a795796
  1. 22
      static/src/js/container.js

22
static/src/js/container.js

@ -39,6 +39,22 @@ odoo.define('vracoop_pos_free_balance_v2.container_balance', function (require)
var scale_screen = this.gui.screen_instances['balancescale'];
var price = scale_screen.format_price(scale_screen.get_product_price());
// Problème de tare
if (container) {
// format tare
var tare = this.format_tare(container);
queue.schedule(function () {
return self.pos.proxy.scale_read_data_price_tare(price, tare).then(function (scale_answer) {
self.set_weight(scale_answer.weight);
if ((scale_answer.error === '30' || scale_answer.error === '31') && scale_answer.weight !== 0) {
self.set_weight(0);
self.pos.proxy.reset_tare();
}
});
}, {duration: 500, repeat: true});
} else {
queue.schedule(function () {
return self.pos.proxy.scale_read_data_price(price).then(function (scale_answer) {
self.set_weight(scale_answer.weight);
@ -48,7 +64,7 @@ odoo.define('vracoop_pos_free_balance_v2.container_balance', function (require)
}
});
}, {duration: 500, repeat: true});
// }
}
}
this._super();
@ -517,7 +533,7 @@ odoo.define('vracoop_pos_free_balance_v2.container_balance', function (require)
});
this.$('.back').click(function(){
self.gui.show_screen('presentation');
self.gui.show_screen('presentation', {container: null});
});
// Ajout pour le pb de tare
@ -913,7 +929,7 @@ odoo.define('vracoop_pos_free_balance_v2.container_balance', function (require)
// self.set_weight(0);
self.set_price(0);
self.pos.proxy.reset_tare();
self.gui.show_screen('presentation');
self.gui.show_screen('presentation', {container: null});
});
$("#pos-header-text-confirm").removeClass('oe_hidden');

Loading…
Cancel
Save