[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:
@@ -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();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user