[FIX] don't forget to set py.bool in context of py.eval/py.evaluate
py.eval really needs to automatically have builtins in its evaluation context... lp bug: https://launchpad.net/bugs/922651 fixed bzr revid: xmo@openerp.com-20120130085557-oqmjs0owgdrwshu0
This commit is contained in:
parent
ffbff476df
commit
b50afe59fb
|
@ -158,7 +158,7 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView#
|
|||
var pair = this.colors[i],
|
||||
color = pair[0],
|
||||
expression = pair[1];
|
||||
if (py.evaluate(expression, context)) {
|
||||
if (py.evaluate(expression, _.extend({bool: py.bool}, context))) {
|
||||
return 'color: ' + color + ';';
|
||||
}
|
||||
// TODO: handle evaluation errors
|
||||
|
|
|
@ -146,7 +146,7 @@ openerp.web.TreeView = openerp.web.View.extend(/** @lends openerp.web.TreeView#
|
|||
var pair = this.colors[i],
|
||||
color = pair[0],
|
||||
expression = pair[1];
|
||||
if (py.evaluate(expression, context)) {
|
||||
if (py.evaluate(expression, _.extend({bool: py.bool}, context))) {
|
||||
return 'color: ' + color + ';';
|
||||
}
|
||||
// TODO: handle evaluation errors
|
||||
|
|
Loading…
Reference in New Issue