From 9b16e2db8a450002011284213398fe1dbc54ac78 Mon Sep 17 00:00:00 2001 From: jvm-odoo Date: Thu, 14 May 2020 06:36:27 +0000 Subject: [PATCH] [FIX] sale_product_configurator: make it works on mobile With this code, we can do an XML customization on customers database if they want to have the product configurator. Note that this is not the entire feature, just a "workaround" waiting for a real feature. OPW-2214095 X-original-commit: ad467a6c1e1e1905ca43912047de4897f3a8fc8c --- .../static/src/js/product_configurator_widget.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 7769a72fc90..b48d0f9274b 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 @@ -93,6 +93,7 @@ ProductConfiguratorWidget.include({ var self = this; this._super.apply(this, arguments); var parentList = self.getParent(); + var unselectRow = (parentList.unselectRow || function() {}).bind(parentList); // form view on mobile if (self.optionalProducts && self.optionalProducts.length !== 0) { self.trigger_up('add_record', { context: self._productsToRecords(self.optionalProducts), @@ -100,13 +101,13 @@ ProductConfiguratorWidget.include({ allowWarning: true, onSuccess: function () { // Leave edit mode of one2many list. - parentList.unselectRow(); + unselectRow(); } }); } else if (!self._isConfigurableLine() && self._isConfigurableProduct()) { // Leave edit mode of current line if line was configured // only through the product configurator. - parentList.unselectRow(); + unselectRow(); } },