From 4debe9f1faf0857626bf41199eb0c9cc661a4964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Gonz=C3=A1lez?= Date: Thu, 6 Aug 2020 21:58:16 +0000 Subject: [PATCH] [FIX] tests: Handle attrs containing numbers instead of bool MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Form class already handles cases for attrs that contain boolean values, e.g.: `attrs="{'readonly': True}"` But it doesnt for integers, e.g.: `attrs="{'readonly': 1}"` This commit changes the expected non-domain value from boolean to integer, because both are valid cases and the former is a subset of the latter. [1] https://github.com/odoo/odoo/blob/b3d4938ba6b1/addons/repair/views/repair_views.xml#L54 closes odoo/odoo#56612 X-original-commit: 782534a429f10e7b114c838687d38aa4080a920c Signed-off-by: Xavier Morel (xmo) Signed-off-by: Luis González [Vauxoo] --- odoo/addons/test_testing_utilities/menu.xml | 2 +- odoo/tests/common.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/odoo/addons/test_testing_utilities/menu.xml b/odoo/addons/test_testing_utilities/menu.xml index 55e8b1c1b44..0bf87b6d5f5 100644 --- a/odoo/addons/test_testing_utilities/menu.xml +++ b/odoo/addons/test_testing_utilities/menu.xml @@ -125,7 +125,7 @@ - + diff --git a/odoo/tests/common.py b/odoo/tests/common.py index 106cde6f74e..5d2b6eb93d0 100644 --- a/odoo/tests/common.py +++ b/odoo/tests/common.py @@ -1676,7 +1676,7 @@ class Form(object): order.append(fname) modifiers[fname] = { - modifier: domain if isinstance(domain, bool) else normalize_domain(domain) + modifier: bool(domain) if isinstance(domain, int) else normalize_domain(domain) for modifier, domain in json.loads(f.get('modifiers', '{}')).items() } ctx = f.get('context')