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
This commit is contained in:
Cédric Krier committed 2015-12-13 14:55:12 +01:00
1 parent c9572763e1
commit e7ef43d9c0
1 file changed
+4 -1
+4 -1
View File
@@ -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):