From 934c0016809c0ff8db4ff238ac7116c5acccf95a Mon Sep 17 00:00:00 2001 From: Adrian Torres Date: Mon, 18 Feb 2019 10:16:13 +0000 Subject: [FIX] expression: properly handle {TRUE,FALSE}_LEAF Before this commit, doing expression.OR() with only FALSE_LEAF would yield [] which is equivalent to TRUE_LEAF and is therefore not correct. The same happened (to a lesser extent) with expression.AND() within an expression.OR(), since the former would return a [] which would be ignored by expression.OR(). See tests for a clearer view of the use cases. Fixes #30113, #26540 closes odoo/odoo#31202 --- odoo/osv/expression.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'odoo/osv') diff --git a/odoo/osv/expression.py b/odoo/osv/expression.py index bef1cb1c523..3025472e0d0 100644 --- a/odoo/osv/expression.py +++ b/odoo/osv/expression.py @@ -233,7 +233,7 @@ def combine(operator, unit, zero, domains): result += domain count += 1 result = [operator] * (count - 1) + result - return result + return result or unit def AND(domains): -- cgit v1.2.3