diff options
| author | Luis González <lgonzalez@vauxoo.com> | 2020-08-06 21:58:16 +0000 |
|---|---|---|
| committer | Luis González <lgonzalez@vauxoo.com> | 2020-08-26 15:13:18 +0000 |
| commit | c0295f4b0211bb29133428b8a803c1ed2b1d22c6 (patch) | |
| tree | bc4ca5d016a83a89cd31cd11900b26fac0967671 /odoo | |
| parent | bde23b82029507e525cf55d11b050af5f820a06b (diff) | |
[FIX] tests: Handle attrs containing numbers instead of bool
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#56609
X-original-commit: 782534a429f10e7b114c838687d38aa4080a920c
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Luis González [Vauxoo] <luisg123v@users.noreply.github.com>
Diffstat (limited to 'odoo')
| -rw-r--r-- | odoo/addons/test_testing_utilities/menu.xml | 2 | ||||
| -rw-r--r-- | 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 @@ <field name="f2" attrs="{'readonly': [['f1', '=', '63'], ['f3', '=', 5]]}"/> <field name="f3"/> <field name="f4"/> - <field name="f5" readonly="1"/> + <field name="f5" attrs="{'readonly': 1}"/> <field name="f6" readonly="1" force_save="1"/> </form> </field> 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') |
