diff options
| author | len-odoo <len@odoo.com> | 2018-11-16 14:29:42 +0000 |
|---|---|---|
| committer | Nans Lefebvre <len@odoo.com> | 2018-12-20 10:41:43 +0000 |
| commit | e5486c12bca68ac6bce7827f75435d4630de2fb4 (patch) | |
| tree | 84606323b5d1076fad392e1d6acd6077b5781636 /odoo/addons/test_testing_utilities/models.py | |
| parent | 03291bdcc81a8183d0a8d376fcf2f20788aaed3a (diff) | |
[FIX] osv: fix combination of unit domain
Combining a list of elements containing only the monoid's unit should return the
unit.
Since the unit is skipped, it would return an empty domain instead of the unit,
meaning that (0, '=', 1) could not be used in a group rule.
To test this, create a record rule on a model M with domain (0, '=', 1)
that applies to group G.
Log in with a user in group G and access model M; you can read everything
(provided no other record rule applies) whereas you should see nothing.
Because of expression.AND(global_domains + [expression.OR(group_domains)])
we want the empty domain to still be left untouched, even if it violates
the OR's unit rules (i.e. OR(empty, OR(R)) = OR(R) <=> OR(empty) = unit).
Meaning that no group rule would reduce to having a (0, '=' 1) group rule.
So in the end we don't really care about all that algebraic nonsense.
closes odoo/odoo#28765
Diffstat (limited to 'odoo/addons/test_testing_utilities/models.py')
0 files changed, 0 insertions, 0 deletions
