Skip to content
Permalink
Browse files

[IMP] support super calls for multiple product_product widgets.

+ some fixes
  • Loading branch information...
Feyensv committed May 15, 2019
1 parent ced0d21 commit a6fc210f0aa366d1d4ae5e026aa3be5e3dcde74f
@@ -19,7 +19,11 @@ ProductConfiguratorWidget.include({
_onProductChange: function (ev) {
var self = this;
var productId = ev.data.changes.product_id.id;
self._checkForEvent(productId, ev.data.dataPointID);
self._checkForEvent(productId, ev.data.dataPointID).then(function (result) {
if (!result) {
return this._super.apply(this, ev);
}
});
},

/**
@@ -42,7 +46,9 @@ ProductConfiguratorWidget.include({
},
dataPointID
);
return true;
}
return false;
});
}
},
@@ -28,11 +28,13 @@ var ProductConfiguratorWidget = relationalFields.FieldMany2One.extend({
* @override
*/
start: function () {
this._super.apply(this, arguments);
prom = this._super.apply(this, arguments);

if (this._isConfigurableProduct()) {
this._addConfigurationEditButton();
}

return prom;
},

/**
@@ -109,11 +111,14 @@ var ProductConfiguratorWidget = relationalFields.FieldMany2One.extend({
/**
* Hook for product_product based configurators
* (event, rental, ...).
* Should return true if product has been configured through wizard
* false if the product wasn't configurable through the wizard
* the result of the super call for wizard extensions
*
* @private
*/
_onProductChange: function (ev) {

return false;
},

/**
@@ -182,10 +182,10 @@ ProductConfiguratorWidget.include({

/**
* This will first modify the SO line to update all the information coming from
* the product configurator using the 'field_changed' ev.
* the product configurator using the 'field_changed' event.
*
* onSuccess from that first method, it will add the optional products to the SO
* using the 'add_record' ev.
* using the 'add_record' event.
*
* Doing both at the same time could lead to unordered product_template/options.
*

0 comments on commit a6fc210

Please sign in to comment.
You can’t perform that action at this time.