From 262d3704ae831600c86fa3cf598da4c06a4cbc7b Mon Sep 17 00:00:00 2001 From: Kamen Zhekov Date: Wed, 3 Nov 2021 07:12:20 +0000 Subject: [PATCH] [FIX] sale_product_configurator: show modal only once w/ mode = options **Description of the issue/feature this PR addresses:** When the product configurator option is enabled and a product that has no variants but has optional products is opened, there are two modals one on top of the other because of an extra trigger of a handler. **Current behavior before PR:** The modal shows up twice, and needs to be closed twice. **Desired behavior after PR is merged:** The modal only shows up once and behaves as expected. opw-2678887 closes odoo/odoo#79500 X-original-commit: bbf5a96e05b7d39401e60981270beb41c54cfbb9 Signed-off-by: Djamel Touati (otd) --- .../static/src/js/product_configurator_renderer.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/sale_product_configurator/static/src/js/product_configurator_renderer.js b/addons/sale_product_configurator/static/src/js/product_configurator_renderer.js index 90ef91823b4..4319e9bcdd4 100644 --- a/addons/sale_product_configurator/static/src/js/product_configurator_renderer.js +++ b/addons/sale_product_configurator/static/src/js/product_configurator_renderer.js @@ -54,7 +54,9 @@ var ProductConfiguratorFormRenderer = FormRenderer.extend(VariantMixin, { this.triggerVariantChange($configuratorContainer); this._applyCustomValues(); - this.trigger_up('handle_add'); + if (this.state.context.configuratorMode !== 'options') { + this.trigger_up('handle_add'); + } }, //--------------------------------------------------------------------------