[FIX] point_of_sale: automatic selection of customer pricelist when using barcode
When using barcode to change the customer to a customer with a different
pricelist than the pos default, the customer pricelist was not
automatically selected.
This is a fine-tuning on 5603b778f6
opw-2047070
closes odoo/odoo#35602
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
This commit is contained in:
@@ -102,7 +102,10 @@ var ScreenWidget = PosBaseWidget.extend({
|
||||
barcode_client_action: function(code){
|
||||
var partner = this.pos.db.get_partner_by_barcode(code.code);
|
||||
if(partner){
|
||||
this.pos.get_order().set_client(partner);
|
||||
if (this.pos.get_order().get_client() !== partner) {
|
||||
this.pos.get_order().set_client(partner);
|
||||
this.pos.get_order().set_pricelist(_.findWhere(this.pos.pricelists, {'id': partner.property_product_pricelist[0]}) || this.pos.default_pricelist);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
this.barcode_error_action(code);
|
||||
|
||||
Reference in New Issue
Block a user