From 5603b778f6a52a0c251be8d871139efdeeff5a40 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Mon, 14 May 2018 12:41:49 +0200 Subject: [PATCH] [FIX] point_of_sale: automatic selection of customer pricelist When changing the customer to a customer with a different pricelist than the pos default, the customer pricelist was not automatically selected. This is because of an oversight in the below revision: f76cc095b8493dfac788f5e1a545adc571f0693f opw-1843709 fixes #24611 --- addons/point_of_sale/static/src/js/screens.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 0b2d94dd71f..1b59aa34cba 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -1172,9 +1172,11 @@ var ClientListScreenWidget = ScreenWidget.extend({ var order = this.pos.get_order(); if( this.has_client_changed() ){ var default_fiscal_position_id = _.findWhere(this.pos.fiscal_positions, {'id': this.pos.config.default_fiscal_position_id[0]}); - if ( this.new_client && this.new_client.property_account_position_id ) { - var client_fiscal_position_id = _.findWhere(this.pos.fiscal_positions, {'id': this.new_client.property_account_position_id[0]}); - order.fiscal_position = client_fiscal_position_id || default_fiscal_position_id; + if ( this.new_client ) { + if (this.new_client.property_account_position_id ){ + var client_fiscal_position_id = _.findWhere(this.pos.fiscal_positions, {'id': this.new_client.property_account_position_id[0]}); + order.fiscal_position = client_fiscal_position_id || default_fiscal_position_id; + } order.set_pricelist(_.findWhere(this.pos.pricelists, {'id': this.new_client.property_product_pricelist[0]}) || this.pos.default_pricelist); } else { order.fiscal_position = default_fiscal_position_id;