Browse Source

[FIX) incompatibility between pos_pricelist and pos_customer_display courtesy @gaelTorrecillas #210

pull/253/head
Sylvain LE GAL 7 years ago
parent
commit
0d88f00c8e
  1. 8
      pos_customer_display/static/src/js/customer_display.js

8
pos_customer_display/static/src/js/customer_display.js

@ -16,6 +16,8 @@ openerp.pos_customer_display = function(instance){
module.PosModel = module.PosModel.extend({ module.PosModel = module.PosModel.extend({
prepare_text_customer_display: function(type, data){ prepare_text_customer_display: function(type, data){
console.log("prepare_text_customer_display");
console.log(data);
if (this.config.iface_customer_display != true) if (this.config.iface_customer_display != true)
return; return;
var line_length = this.config.customer_display_line_length || 20; var line_length = this.config.customer_display_line_length || 20;
@ -200,8 +202,10 @@ openerp.pos_customer_display = function(instance){
var res = OrderlineSuper.prototype.set_quantity.call(this, quantity); var res = OrderlineSuper.prototype.set_quantity.call(this, quantity);
if (quantity != 'remove') { if (quantity != 'remove') {
var line = this; var line = this;
if(this.selected){
this.pos.prepare_text_customer_display('add_update_line', {'line': line}); this.pos.prepare_text_customer_display('add_update_line', {'line': line});
} }
}
return res; return res;
}, },
@ -209,15 +213,19 @@ openerp.pos_customer_display = function(instance){
var res = OrderlineSuper.prototype.set_discount.call(this, discount); var res = OrderlineSuper.prototype.set_discount.call(this, discount);
if (discount) { if (discount) {
var line = this; var line = this;
if(this.selected){
this.pos.prepare_text_customer_display('add_update_line', {'line': line}); this.pos.prepare_text_customer_display('add_update_line', {'line': line});
} }
}
return res; return res;
}, },
set_unit_price: function(price){ set_unit_price: function(price){
var res = OrderlineSuper.prototype.set_unit_price.call(this, price); var res = OrderlineSuper.prototype.set_unit_price.call(this, price);
var line = this; var line = this;
if(this.selected){
this.pos.prepare_text_customer_display('add_update_line', {'line': line}); this.pos.prepare_text_customer_display('add_update_line', {'line': line});
}
return res; return res;
}, },

Loading…
Cancel
Save