From 73f2e9be09b4e874f0c78b5b08a29c640854b57e Mon Sep 17 00:00:00 2001 From: oco-odoo Date: Tue, 6 Apr 2021 15:00:44 +0000 Subject: [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) --- odoo/tests/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'odoo') 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) -- cgit v1.2.3