summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorDevendra Kavthekar <dek-odoo@users.noreply.github.com>2016-10-13 19:31:22 +0530
committerRaphael Collet <rco@openerp.com>2016-10-13 16:01:21 +0200
commitc63c225274c4e6b0647e24fda91f72de4f046430 (patch)
tree26eb6f166e41e12c896ffff30ed8518daaf88a14 /addons/web/static/src
parent5abe76c2d27a6ab07eebb382205c841acf32c551 (diff)
[FIX] web: is_false() for reference field widget. (#9335)
In the widget, the value of reference field is a pair `[val1, val2]`. When the field is blank, its value is `[false,false]`, thus checking `[false,false] === false` never succeeds, and this breaks the check for required fields.
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/views/form_widgets.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/web/static/src/js/views/form_widgets.js b/addons/web/static/src/js/views/form_widgets.js
index 3b630d4232d..15acd788263 100644
--- a/addons/web/static/src/js/views/form_widgets.js
+++ b/addons/web/static/src/js/views/form_widgets.js
@@ -1152,6 +1152,9 @@ var FieldReference = common.AbstractField.extend(common.ReinitializeFieldMixin,
this.m2o.do_toggle(!!this.get('value')[0]);
this.reference_ready = true;
},
+ is_false: function() {
+ return this.get('value')[0] == false || this.get('value')[1] == false;
+ },
});
var FieldBinary = common.AbstractField.extend(common.ReinitializeFieldMixin, {