[FIX] web: legacy fields

If the source field widget emitting a field_changed event is a m2o,
the field changes of the event will all be considered
as changes targeting a m2o and converted accordingly, resulting in
server errors because the `onchange` call received a [None, None] value
for a standard field (e.g. float).

closes odoo/odoo#100007

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit is contained in:
Victor Feyens
2022-09-12 13:49:49 +02:00
parent 98df7cdb41
commit 74aec75de9
@@ -109,7 +109,7 @@ class FieldAdapter extends ComponentAdapter {
const proms = [];
for (const fieldName in payload.changes) {
let value = payload.changes[fieldName];
const fieldType = record.fields[name].type;
const fieldType = record.fields[fieldName].type;
if (fieldType === "many2one" && value) {
value = [value.id, value.display_name];
} else if (fieldType === "one2many" || fieldType === "many2many") {