summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorJorge Pinna Puissant <jpp@odoo.com>2019-08-09 12:04:28 +0000
committerJorge Pinna Puissant <jpp@odoo.com>2019-08-09 12:55:38 +0000
commit0e9d200d09efdd44cb00a029e7b08aaa360d45cf (patch)
tree1009ea5854d9ae9244d9156e57c06d9fa7a5263e /addons
parentf6ce242b0f0d606feae56d4e44cb69f5f9e25663 (diff)
[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 5603b778f6a52a0c251be8d871139efdeeff5a40 opw-2047070 closes odoo/odoo#35602 Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/point_of_sale/static/src/js/screens.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js
index a91391441b3..482b023b25e 100644
--- a/addons/point_of_sale/static/src/js/screens.js
+++ b/addons/point_of_sale/static/src/js/screens.js
@@ -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);