[FIX] expression: ensure tuple to compare leaf with TRUE/FALSE leaf
When setting a custom filter with as domain [(0, '=', 1)] the domain was rejected, because (0, '=', 1) wasn't considered as a valid leaf, while it is. This is because the Javascript converts this domain using list instead of tuple [(0, '=', 1)] -> [[0, '=', 1]] And therefore, comparing the "list" leaf to the TRUE/FALSE leaf tuple failed. Ensuring "element" as a tuple solves the issue. opw-640306
This commit is contained in:
parent
cc61d467fa
commit
54a90179bb
|
@ -401,7 +401,7 @@ def is_leaf(element, internal=False):
|
||||||
and len(element) == 3 \
|
and len(element) == 3 \
|
||||||
and element[1] in INTERNAL_OPS \
|
and element[1] in INTERNAL_OPS \
|
||||||
and ((isinstance(element[0], basestring) and element[0])
|
and ((isinstance(element[0], basestring) and element[0])
|
||||||
or element in (TRUE_LEAF, FALSE_LEAF))
|
or tuple(element) in (TRUE_LEAF, FALSE_LEAF))
|
||||||
|
|
||||||
|
|
||||||
# --------------------------------------------------
|
# --------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue