diff options
| author | Géry Debongnie <ged@odoo.com> | 2017-05-22 13:05:25 +0200 |
|---|---|---|
| committer | Géry Debongnie <ged@odoo.com> | 2017-05-22 14:25:30 +0200 |
| commit | 4b8c34be15f355958bbdb64c440018bdbe72ad3c (patch) | |
| tree | ab110709eaebea1e6ded91dd1729d1d624f46e79 /addons/web/static/src/xml/base.xml | |
| parent | 967978c96ea1a30a5fd566cf26b1dec1c24e4013 (diff) | |
[FIX] web: properly evaluate context with x2m
The motivation for this commit was to fix a wrong evaluation context for
x2m fields: it was using a list of res_id, which may contain virtual
ids.
For example, it could be seen in the form view for journal entries:
adding the first line (field line_ids) was fine, but clicking on 'Add an
item' a second time caused a crash. The reason was that the line_ids
was explicitely added to the context in the view, and the second time we
add a line, the web client sent a list looking like this [35,
'virtual_43'] to the server, in the nameget context.
The proper behaviour is to send a list of commands for those fields.
This means that we had to do some non trivial changes in the
getEvalContext method: we stop using the get method with raw: true. It
was nice to use the same method, but the eval context is actually
different that the values returned by the get method. That was the
motivation to introduce the 'noUnsetNumeric' flag, but now, we simply
create another method and let each method do its own work.
TLDR: eval contexts are hard...
Diffstat (limited to 'addons/web/static/src/xml/base.xml')
0 files changed, 0 insertions, 0 deletions
