diff options
| author | Aaron Bohy <aab@odoo.com> | 2017-06-13 08:46:15 +0200 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2017-06-13 09:26:40 +0200 |
| commit | 708c1c2915563a40a1e4c736b4fd11ffd89280f8 (patch) | |
| tree | b012d2688f09610fd1a499006c5976c7749e841c /addons/web/static/src/js/views/basic/basic_model.js | |
| parent | ebd17217c4e7e9ff06d97028de64fb2fc44d6266 (diff) | |
[FIX] web: false id should remain false in evalContext
'id' is a particular field that should not be considered like other
integer fields. For instance, in the evalContext, its value should
not fallback to 0 if it is false. This would break domains in attrs
like ['id', '=', False], which is supposed to be true on new (not
saved yet) records.
This was for example the case in the Product form view: go to Sales
Orders form view, add a line, on the product field choose 'Create
and Edit', try to save the product -> error: field Product Template
is required but not set (actually it is invisible), as its required
modifier says ['id', '!=', False], which was always the case.
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_model.js')
| -rw-r--r-- | addons/web/static/src/js/views/basic/basic_model.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/basic/basic_model.js b/addons/web/static/src/js/views/basic/basic_model.js index 20066b858f1..6c23550ba2e 100644 --- a/addons/web/static/src/js/views/basic/basic_model.js +++ b/addons/web/static/src/js/views/basic/basic_model.js @@ -2176,7 +2176,7 @@ var BasicModel = AbstractModel.extend({ if (context[fieldName] === null) { context[fieldName] = false; } - if (!field) { + if (!field || field.name === 'id') { continue; } if (field.type === 'float' || |
