Browse Source

FIX when clicking on "Display Total to Customer", the query is now sent only once to the POSbox

Patch written with the kind help of Sylvain Calador
pull/30/head
Alexis de Lattre 10 years ago
parent
commit
a0d14e2147
  1. 26
      pos_customer_display/static/src/js/customer_display.js

26
pos_customer_display/static/src/js/customer_display.js

@ -241,20 +241,16 @@ openerp.pos_customer_display = function(instance){
});
/* Handle Button "Display Total to Customer" */
/* TODO: understand why Odoo sends the prepare_text_customer_display
3 times to the Posbox/LCD when the user clicks on the button
'Show total to customer' */
module.OrderWidget.include({
update_summary: function(){
this._super();
var self = this;
if (this.pos.config.iface_customer_display){
this.el.querySelector('.show-total-to-customer')
.removeEventListener('click', function(){self.pos.prepare_text_customer_display('addPaymentline', {})});
this.el.querySelector('.show-total-to-customer')
.addEventListener('click', function(){self.pos.prepare_text_customer_display('addPaymentline', {})});
}
},
});
var _saved_renderElement = module.OrderWidget.prototype.renderElement;
module.OrderWidget.prototype.renderElement = function() {
_saved_renderElement.apply(this, arguments);
var self = this;
if (self.pos.config.iface_customer_display) {
self.el.querySelector('.show-total-to-customer')
.addEventListener('click', function(){
self.pos.prepare_text_customer_display('addPaymentline', {})
});
}
};
};
Loading…
Cancel
Save