From d4aa2decde8b0017b99b5566783a26d2aa880abc Mon Sep 17 00:00:00 2001 From: andreparames Date: Tue, 21 Apr 2015 11:32:50 +0100 Subject: [PATCH] [FIX] web: onchange compare changes using === operator The onchange handler is doing a weak comparison between the values received from the onchange() method and the current field value, which leads to a falsy value such as "0000" being treated as equal to False. This patches changes the operator to enforce non-coercive equality. Fixes #6405 --- addons/web/static/src/js/view_form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 3c45896d409..0033b3147a1 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -636,7 +636,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM // If field is not defined in the view, just ignore it if (field) { var value_ = values[f]; - if (field.get_value() != value_) { + if (field.get_value() !== value_) { field._inhibit_on_change_flag = true; field.set_value(value_); field._inhibit_on_change_flag = false;