From c5e061fec9bc1594f7a99e26970ecf12211ed95f Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 17 Jun 2011 11:24:36 +0200 Subject: [PATCH] [FIX] don't make explicit boolean comparisons without identity In javascript, '0 == false', '1 == true' and even '"1" == true'. Either use variables directly in a boolean context, or use type-strict equality (===) to ensure the variable is an actual boolean, not some other type coerced to a boolean bzr revid: xmo@openerp.com-20110617092436-s8b5v4v5ytbonvi1 --- addons/base_graph/static/src/js/graph.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/base_graph/static/src/js/graph.js b/addons/base_graph/static/src/js/graph.js index e0a3c1feeea..7a9073996e9 100644 --- a/addons/base_graph/static/src/js/graph.js +++ b/addons/base_graph/static/src/js/graph.js @@ -250,7 +250,7 @@ openerp.base_graph.GraphView = openerp.base.Controller.extend({ template:function(obj){ if(x_ax['template']){ var val = obj[x_ax['template']]; - val = (typeof val == 'object')?val[1]:(val==false?'Undefined':val); + val = (typeof val == 'object')?val[1]:(!val?'Undefined':val); return val; }else{ return obj; @@ -263,7 +263,7 @@ openerp.base_graph.GraphView = openerp.base.Controller.extend({ template:function(obj){ if(y_ax['template']){ var vals = obj[y_ax['template']]; - vals = (typeof vals == 'object')?vals[1]:(vals==false?'Undefined':vals); + vals = (typeof vals == 'object')?vals[1]:(!vals?'Undefined':vals); return vals; }else{ return obj;