[FIX] web: keep m2m value in list view

Currently, when rendering a list view cell with a many2many we would
empty the list of ids, and fill it again once a name_get is resolved.

But in some instance, the code could use the data when it has been
emptied out.

For example, if we set the tax_id field (inside the order_line list view
inside the sale.order form view) as requred, if we modify the order line
and save directly (without clicking outside of the list view) we can get
an incorrect error saying that the "Order Line" is not valid.

It has been reproduced when saving with CTRL + SHIFT + S on google
chrome and firefox, and there have been reports that for some
configuration it also happen when clicking on the "Save" button.

This commit change the behaviour so the value is kept whilst the name_get
is ongoing, and just use a default "false" value for the name during this
interval.

closes #13478
opw-668067
This commit is contained in:
Nicolas Lempereur 2016-09-14 14:33:50 +02:00
parent 3e4206b4d4
commit 1da79b872e
1 changed files with 2 additions and 2 deletions

View File

@ -1125,8 +1125,8 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web.
_(names).pluck(1).join(', '));
record.set(column.id, ids);
});
// temp empty value
record.set(column.id, false);
// temporary empty display name
record.set(column.id + '__display', false);
}
}
return column.format(record.toForm().data, {