From 708c1c2915563a40a1e4c736b4fd11ffd89280f8 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Tue, 13 Jun 2017 08:46:15 +0200 Subject: [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. --- addons/web/static/src/js/views/basic/basic_model.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src/js/views/basic/basic_model.js') 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' || -- cgit v1.2.3