[IMP] sale_product_configurator: empty line on configuration cancel.
This commit is contained in:
@@ -247,7 +247,7 @@ var ProductConfiguratorFormController = FormController.extend({
|
||||
_onModalClose: function () {
|
||||
if (this.renderer.state.context.configuratorMode === 'options'
|
||||
&& this._wasConfirmed !== true) {
|
||||
this._onAddRootProductOnly();
|
||||
this.do_action({type: 'ir.actions.act_window_close'});
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -152,8 +152,8 @@ ProductConfiguratorWidget.include({
|
||||
if (result && !result.special) {
|
||||
self._addProducts(result, dataPointId);
|
||||
} else {
|
||||
// is this restoreProductTemplateId ability useful ???
|
||||
if (self.restoreProductTemplateId) {
|
||||
// if configurator opened in edit mode.
|
||||
self.trigger_up('field_changed', {
|
||||
dataPointID: dataPointId,
|
||||
preventProductIdCheck: true,
|
||||
@@ -161,6 +161,16 @@ ProductConfiguratorWidget.include({
|
||||
product_template_id: self.restoreProductTemplateId.data
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// if configurator opened to create line:
|
||||
// destroy line if configurator closed during configuration process.
|
||||
self.trigger_up('field_changed', {
|
||||
dataPointID: dataPointId,
|
||||
changes: {
|
||||
product_template_id: false,
|
||||
product_id: false,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user