summaryrefslogtreecommitdiff
path: root/odoo
diff options
context:
space:
mode:
authoroco-odoo <oco@odoo.com>2021-04-06 15:00:44 +0000
committeroco-odoo <oco@odoo.com>2021-04-08 13:16:18 +0000
commit73f2e9be09b4e874f0c78b5b08a29c640854b57e (patch)
tree8cdcf73d219a3017d2681d8709abae794a101c60 /odoo
parent675feb254ed3448571818a77c920012cbd066c8b (diff)
[FIX] base: form view emulator: bidirectional definition of 'in' and 'not in'
Doing domains like [('something_ids', 'in', 4)] crashed the emulator because it was trying to check something was 'in 4', instead of reversing the check (as real form views do). closes odoo/odoo#68966 X-original-commit: eb14583442f2729182ffb8ec7b069e2505df3577 Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Diffstat (limited to 'odoo')
-rw-r--r--odoo/tests/common.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/odoo/tests/common.py b/odoo/tests/common.py
index 2abeb7bd3a8..dda4eac078e 100644
--- a/odoo/tests/common.py
+++ b/odoo/tests/common.py
@@ -1810,8 +1810,8 @@ class Form(object):
'<=': operator.le,
'>=': operator.ge,
'>': operator.gt,
- 'in': lambda a, b: a in b,
- 'not in': lambda a, b: a not in b
+ 'in': lambda a, b: (a in b) if isinstance(b, (tuple, list)) else (b in a),
+ 'not in': lambda a, b: (a not in b) if isinstance(b, (tuple, list)) else (b not in a),
}
def _get_context(self, field):
c = self._view['contexts'].get(field)