From 54a90179bb477a0ce3814395a38e5e98c8e9e477 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 20 May 2015 15:33:10 +0200 Subject: [PATCH] [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 --- openerp/osv/expression.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/osv/expression.py b/openerp/osv/expression.py index 18c82306bc5..4715d9268c4 100644 --- a/openerp/osv/expression.py +++ b/openerp/osv/expression.py @@ -401,7 +401,7 @@ def is_leaf(element, internal=False): and len(element) == 3 \ and element[1] in INTERNAL_OPS \ and ((isinstance(element[0], basestring) and element[0]) - or element in (TRUE_LEAF, FALSE_LEAF)) + or tuple(element) in (TRUE_LEAF, FALSE_LEAF)) # --------------------------------------------------