From 7a67c4f94d9055152fc24bcd5f15d6e620494375 Mon Sep 17 00:00:00 2001 From: Victor Feyens Date: Fri, 10 Jun 2022 16:24:10 +0000 Subject: [PATCH] [FIX] sale_product_*: do not reset product on edition cancel After opening the configurator wizard in "edit" mode (through the pencil icon shown next to the product in edit mode), if you clicked either on the "Cancel" button or on the "X" to leave/close the wizard, the product was reset on the SOline. Cancelling a modification should keep the state before the modification and not reset the line. This is a regression from the behavior in saas-12.3. closes odoo/odoo#93666 X-original-commit: 0f0d3a20910d20221f9b80fc290f743091ecd8b7 Signed-off-by: Victor Feyens (vfe) --- .../static/src/js/product_configurator_widget.js | 1 + .../static/src/js/product_matrix_configurator.js | 1 + 2 files changed, 2 insertions(+) diff --git a/addons/sale_product_configurator/static/src/js/product_configurator_widget.js b/addons/sale_product_configurator/static/src/js/product_configurator_widget.js index 9132eb011c3..64da75d8a9f 100644 --- a/addons/sale_product_configurator/static/src/js/product_configurator_widget.js +++ b/addons/sale_product_configurator/static/src/js/product_configurator_widget.js @@ -198,6 +198,7 @@ ProductConfiguratorWidget.include({ this._super.apply(this, arguments); return; } + this.restoreProductTemplateId = this.recordData.product_template_id; // If line has been set up through the product_configurator: this._openProductConfigurator({ configuratorMode: 'edit', diff --git a/addons/sale_product_matrix/static/src/js/product_matrix_configurator.js b/addons/sale_product_matrix/static/src/js/product_matrix_configurator.js index 7ea0021053c..eb43f416e22 100644 --- a/addons/sale_product_matrix/static/src/js/product_matrix_configurator.js +++ b/addons/sale_product_matrix/static/src/js/product_matrix_configurator.js @@ -54,6 +54,7 @@ ProductConfiguratorWidget.include({ if (result && result[0].product_add_mode === 'matrix') { self._openGridConfigurator(productTemplateId, self.dataPointID, true); } else { + self.restoreProductTemplateId = self.recordData.product_template_id; // Call super only if product_add_mode different than matrix // to avoid product configurator opening (which is the default case). self._openProductConfigurator({