3
0
Fork 0

[FIX] web_widget_one2many_product_picker: Discard Changes

13.0
Alexandre D. Díaz 2021-05-24 12:04:01 +02:00
parent 699cc2e5bc
commit dd9a97bc65
1 changed files with 8 additions and 5 deletions

View File

@ -313,7 +313,7 @@ odoo.define("web_widget_one2many_product_picker.BasicModel", function(require) {
* @override * @override
*/ */
_performOnChange: function(record) { _performOnChange: function(record) {
if (record.context && record.context.ignore_warning) { if (record && record.context && record.context.ignore_warning) {
const this_mp = _.clone(this); const this_mp = _.clone(this);
const super_call = this.trigger_up; const super_call = this.trigger_up;
this_mp.trigger_up = function(event_name, data) { this_mp.trigger_up = function(event_name, data) {
@ -343,11 +343,14 @@ odoo.define("web_widget_one2many_product_picker.BasicModel", function(require) {
} }
const element = this.localData[id]; const element = this.localData[id];
this._visitChildren(element, function(elem) { this._visitChildren(element, function(elem) {
if (_.isEmpty(elem._changes)) { if (
if (elem.context.product_picker_modified) { elem &&
elem.context &&
elem.context.product_picker_modified &&
_.isEmpty(elem._changes)
) {
elem.context.product_picker_modified = false; elem.context.product_picker_modified = false;
} }
}
}); });
}, },
}); });