[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
This commit is contained in:
jvm-odoo
2020-05-14 13:41:09 +00:00
parent 88f3d9c076
commit 9b16e2db8a
@@ -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();
}
},