From e7ef43d9c035d972ee49ccb3d255dbcfff98790c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 13 Dec 2015 14:55:12 +0100 Subject: [PATCH] Catch TypeError when evaluating leaf in domain inversion Some values are comparable for Python but valid for Tryton domain like the datetime.* and None. issue5163 review16881003 --- tryton/common/domain_inversion.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tryton/common/domain_inversion.py b/tryton/common/domain_inversion.py index 9e232f0ccf..7e85bcf6f1 100644 --- a/tryton/common/domain_inversion.py +++ b/tryton/common/domain_inversion.py @@ -89,7 +89,10 @@ def eval_leaf(part, context, boolop=operator.and_): '=': 'in', '!=': 'not in', }[operand] - return OPERATORS[operand](context_field, value) + try: + return OPERATORS[operand](context_field, value) + except TypeError: + return False def inverse_leaf(domain):