[IMP] web_widget_one2many_product_picker: Force qty to 1.0 in virtual states

pull/1858/head
Alexandre D. Díaz 2021-02-15 17:38:42 +01:00
parent 0fb8c1b12b
commit 372965662a
1 changed files with 2 additions and 0 deletions

View File

@ -255,6 +255,8 @@ odoo.define("web_widget_one2many_product_picker.One2ManyProductPickerRecord", fu
var model = this.options.basicFieldParams.model;
var scontext = _.extend(
{}, this._getInternalVirtualRecordContext(), context);
// Force qty to 1.0 to launch correct onchanges
scontext[`default_${this.options.fieldMap.product_uom_qty}`] = 1.0;
var sdata = _.extend({}, this._getInternalVirtualRecordData(), data);
return model.createVirtualRecord(
this.options.basicFieldParams.value.id, {