summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/view_tree.js
diff options
context:
space:
mode:
authorArthur Maniet <arthurmaniet@me.com>2015-02-04 13:45:19 +0100
committerXavier Morel <xmo@odoo.com>2015-02-05 13:08:15 +0100
commitf0cefa72325cabcd2bff1952816a84a380dc6e2f (patch)
tree0d11938b1c0376d6085e234df522d67879dc43db /addons/web/static/src/js/view_tree.js
parent691254cbfe0d4c64762d2d1c2c5e3b0ad2c5423b (diff)
[ADD] py.js: len() and truthiness on lists, tuples and dicts
* use new support to colorize reconciled bank statement lines * fixes tokenization of ``is not`` to not blow up on ``not foo`` * improves calling code to get truthiness of evaluated expression instead of truthiness of javascript-equivalent objects: an empty list is falsy in Python but truthy in javascript, since the evaluated expression is in Python one would expect Python truthiness rules without having to manually convert to boolean closes #5070
Diffstat (limited to 'addons/web/static/src/js/view_tree.js')
-rw-r--r--addons/web/static/src/js/view_tree.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web/static/src/js/view_tree.js b/addons/web/static/src/js/view_tree.js
index aac7198f2c3..45cc183511a 100644
--- a/addons/web/static/src/js/view_tree.js
+++ b/addons/web/static/src/js/view_tree.js
@@ -145,7 +145,7 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie
var pair = this.colors[i],
color = pair[0],
expression = pair[1];
- if (py.evaluate(expression, context).toJSON()) {
+ if (py.PY_isTrue(py.evaluate(expression, context))) {
return 'color: ' + color + ';';
}
// TODO: handle evaluation errors