changeset 5850f1210e5d in tryton:default
details: https://hg.tryton.org/tryton?cmd=changeset&node=5850f1210e5d
description:
Do not return None when evaluating domain with in operator
When the operator is 'in' and the value contains None,
Field._domain_add_null
adds an equal operator against NULL. So this must be managed like the
'='
operator.
issue9906
review332201005
diffstat:
tryton/common/domain_inversion.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diffs (15 lines):
diff -r 0a1339c4ec24 -r 5850f1210e5d tryton/common/domain_inversion.py
--- a/tryton/common/domain_inversion.py Thu Mar 18 21:31:07 2021 +0100
+++ b/tryton/common/domain_inversion.py Sat Mar 20 12:33:09 2021 +0100
@@ -96,7 +96,10 @@
return bool(context.get(field.split('.')[0]))
context_field = context.get(field)
if (operand not in {'=', '!='}
- and (context_field is None or value is None)):
+ and (context_field is None or value is None)
+ and not (operand in {'in', 'not in'}
+ and context_field is None
+ and (isinstance(value, (list, tuple)) and None in value))):
return
if isinstance(context_field, datetime.date) and not value:
if isinstance(context_field, datetime.datetime):