[FIX] web_widget_one2many_product_picker: setState when the widget was destroyed

pull/1858/head
Alexandre D. Díaz 2020-12-10 03:05:15 +01:00
parent 9fa7deb549
commit eb94bd90b5
1 changed files with 9 additions and 0 deletions

View File

@ -148,6 +148,15 @@ odoo.define("web_widget_one2many_product_picker.One2ManyProductPickerRecord", fu
* @param {Object} recordSearch
*/
_setState: function (viewState, recordSearch) {
// No parent = product_pricker widget destroyed
// So this is a 'zombie' record. Destroy it!
if (!this.getParent()) {
this.on_detach_callback();
this.destroy();
return;
}
this.fields = this.getParent().state.fields;
this.fieldsInfo = this.getParent().state.fieldsInfo.form;
this.state = viewState;