forked from Techsystech/web
[FIX] web_widget_one2many_product_picker: Discard Changes
parent
699cc2e5bc
commit
dd9a97bc65
|
@ -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,10 +343,13 @@ 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.product_picker_modified = false;
|
elem.context &&
|
||||||
}
|
elem.context.product_picker_modified &&
|
||||||
|
_.isEmpty(elem._changes)
|
||||||
|
) {
|
||||||
|
elem.context.product_picker_modified = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue