diff options
| author | jerome hanke (jhk) <jhk@odoo.com> | 2020-07-12 23:18:16 +0000 |
|---|---|---|
| committer | jerome hanke (jhk) <jhk@odoo.com> | 2020-08-03 07:04:36 +0000 |
| commit | 1e0f4188e5ff218324229f9570fe6f6ec545e575 (patch) | |
| tree | 0ee5b3254b50c3990e759c200ef826ea98cdccf5 | |
| parent | 1c21fcf275633d05b55877256b64f72857b99a61 (diff) | |
[FIX] odoo: one2many fields queries with res_id are narrowed by res_model
Steps to reproduce:
- install helpdesk, hr_expense (the demo data has a clear example of the bug)
- go to helpdesk > tickets > set a custom filter > "activities is set"
Previous behavior:
the results show the ticket with id=2 as if it had an activity set.
Because the search sql query collides with other activities set on other models
(hr.expense.sheet in this example)
Current behavior:
the sql query returns the proper result
opw-2273680
closes odoo/odoo#55297
X-original-commit: 6e90c41413f6a726c08071c71d01c738a6538079
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
| -rw-r--r-- | odoo/osv/expression.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/odoo/osv/expression.py b/odoo/osv/expression.py index 5be77f295a8..14d38dedbba 100644 --- a/odoo/osv/expression.py +++ b/odoo/osv/expression.py @@ -800,7 +800,7 @@ class expression(object): elif field.type == 'one2many': domain = field.get_domain_list(model) - inverse_is_int = comodel._fields[field.inverse_name].type == 'integer' + inverse_is_int = comodel._fields[field.inverse_name].type in ('integer', 'many2one_reference') unwrap_inverse = (lambda ids: ids) if inverse_is_int else (lambda recs: recs.ids) if right is not False: |
