diff options
| author | Joren Van Onder <jov@odoo.com> | 2018-02-16 11:30:21 -0800 |
|---|---|---|
| committer | Joren Van Onder <jov@odoo.com> | 2018-02-16 13:48:59 -0800 |
| commit | f76cc095b8493dfac788f5e1a545adc571f0693f (patch) | |
| tree | 9f82bf2044e1b0d10b2ded757bf83cd81e0f2a36 | |
| parent | ff019aa52f4857b45ebad301757970d99df37aee (diff) | |
[FIX] point_of_sale: fix the behavior of default fiscal positions
Issue 1) and 3) in 73f7567627f2440d898984ed167befa62ed289c4 still
occured in 11.0. It seems this was not fully forward-ported, most
likely due to conflicts caused by
ac89783d2f6cf5477de1c5e576e90ee0f576c9cc.
opw-782855
| -rw-r--r-- | addons/point_of_sale/static/src/js/screens.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index d4b36313abb..dadd9cffbb8 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -1170,8 +1170,9 @@ 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 ) { - order.fiscal_position = _.findWhere(this.pos.fiscal_positions, {'id': this.new_client.property_account_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; 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; |
