[FIX] web_widget_one2many_product_picker: Set product_id using the context

This commit is contained in:
Alexandre D. Díaz
2021-05-03 22:01:05 +02:00
parent 093850fb44
commit 80020e8c7b

View File

@@ -249,23 +249,21 @@ odoo.define("web_widget_one2many_product_picker.One2ManyProductPickerRecord", fu
var context = {};
context["default_" + this.options.basicFieldParams.relation_field] =
this.options.basicFieldParams.state.id || null;
context["default_" + this.options.fieldMap.product] =
this.recordSearch.id || null;
return context;
},
/**
* Forced data used in virtual states.
* Be careful with the onchanges sequence. Think as user interaction, not as CRUD operation.
* Be careful with the onchanges sequence. Think as user interaction ("ADD", "DELETE", ... commands), not as CRUD operation.
*
* @private
* @returns {Object}
*/
_getInternalVirtualRecordData: function () {
var data = {};
data[this.options.fieldMap.product] = {
operation: 'ADD',
id: this.recordSearch.id,
};
return data;
_getInternalVirtualRecordData: function() {
// To be overwritten
return {};
},
/**