|
|
@ -39,16 +39,32 @@ 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()); |
|
|
|
|
|
|
|
queue.schedule(function () { |
|
|
|
return self.pos.proxy.scale_read_data_price(price).then(function (scale_answer) { |
|
|
|
self.set_weight(scale_answer.weight); |
|
|
|
// self.set_price(scale_answer.price);
|
|
|
|
if ((scale_answer.error === '30' || scale_answer.error === '31') && scale_answer.weight !== 0) { |
|
|
|
self.set_weight(0); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, {duration: 500, repeat: true}); |
|
|
|
// }
|
|
|
|
// 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); |
|
|
|
// self.set_price(scale_answer.price);
|
|
|
|
if ((scale_answer.error === '30' || scale_answer.error === '31') && scale_answer.weight !== 0) { |
|
|
|
self.set_weight(0); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, {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'); |
|
|
|