[FIX] expression: a valid leaf must have a non empty string as first element or be the magic TRUE_LEAF/FALSE_LEAF

lp bug: https://launchpad.net/bugs/1197323 fixed

bzr revid: chs@openerp.com-20130719091903-28ez0txxyjh6qiii
This commit is contained in:
Christophe Simonis 2013-07-19 11:19:03 +02:00
parent 1e9789baf8
commit 03381c761d
1 changed files with 3 additions and 1 deletions

View File

@ -399,7 +399,9 @@ def is_leaf(element, internal=False):
INTERNAL_OPS += ('inselect',)
return (isinstance(element, tuple) or isinstance(element, list)) \
and len(element) == 3 \
and element[1] in INTERNAL_OPS
and element[1] in INTERNAL_OPS \
and ((isinstance(element[0], basestring) and element[0])
or element in (TRUE_LEAF, FALSE_LEAF))
# --------------------------------------------------