From 0f19ecec46b9b2bc70236fe255cbe32ce4378b3a Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Tue, 1 Jun 2021 14:18:43 +0000 Subject: [PATCH] [FIX] point_of_sale: default state/country are not saved on creating STEPS: * set state/country for current company * open POS * create partner without changing default state/country values BEFORE: the values are not saved AFTER: the values are saved WHY: the values are set, but not copied to `changes` variable: https://github.com/odoo/odoo/blob/2a8f777c04bdbdce77dc44d92e099612f158cbef/addons/point_of_sale/static/src/js/Screens/ClientListScreen/ClientListScreen.js#L43-L44 --- opw-2519788 closes odoo/odoo#71981 X-original-commit: b95ad8033c58d54f0b7137117be6d506f0b5dc56 Signed-off-by: pimodoo Signed-off-by: Ivan Yelizariev // IEL --- .../src/js/Screens/ClientListScreen/ClientDetailsEdit.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/Screens/ClientListScreen/ClientDetailsEdit.js b/addons/point_of_sale/static/src/js/Screens/ClientListScreen/ClientDetailsEdit.js index ff664f162e5..3984b2483e9 100644 --- a/addons/point_of_sale/static/src/js/Screens/ClientListScreen/ClientDetailsEdit.js +++ b/addons/point_of_sale/static/src/js/Screens/ClientListScreen/ClientDetailsEdit.js @@ -10,7 +10,11 @@ odoo.define('point_of_sale.ClientDetailsEdit', function(require) { constructor() { super(...arguments); this.intFields = ['country_id', 'state_id', 'property_product_pricelist']; - this.changes = {}; + const partner = this.props.partner; + this.changes = { + 'country_id': partner.country_id && partner.country_id[0], + 'state_id': partner.state_id && partner.state_id[0], + }; } mounted() { this.env.bus.on('save-customer', this, this.saveChanges);