diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2019-12-05 14:54:31 +0000 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2019-12-06 09:06:07 +0000 |
| commit | 2178ad9671186ea4d766fc5f125ce66780cf91b7 (patch) | |
| tree | 8cd9b877c14e8659ea8e184adf3821c1dc20aeac /odoo/osv | |
| parent | 2fa050b3aed37701f7a0cff52dcb7e991b11435e (diff) | |
[FIX] expression: use of `child_of` with `many2many`
- Go to Contacts
- Search by 'Tag' with a non existing tag
A crash occurs.
This is because of an incorrect SQL:
`WHERE "category_id" IN ()`
In case of an empty list `ids2`, we fall back on `(None,)`
Note that it appears only in v13 because `child_of` was added at [1],
but the issue also exists in v12.
[1] https://github.com/odoo/odoo/blob/b6325ae45b830a725f6ab6706b70f65c809be4a7/odoo/addons/base/views/res_partner_views.xml#L471
opw-2151129
closes odoo/odoo#41479
X-original-commit: 6372fba2cb93c92c41a6a55ede56a39dfc43f701
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'odoo/osv')
| -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 221fd0ba6c9..e9efe04fc96 100644 --- a/odoo/osv/expression.py +++ b/odoo/osv/expression.py @@ -1010,7 +1010,7 @@ class expression(object): push(create_substitution_leaf(leaf, ('id', 'in', ids2), model)) else: subquery = 'SELECT "%s" FROM "%s" WHERE "%s" IN %%s' % (rel_id1, rel_table, rel_id2) - push(create_substitution_leaf(leaf, ('id', 'inselect', (subquery, [tuple(ids2)])), internal=True)) + push(create_substitution_leaf(leaf, ('id', 'inselect', (subquery, [tuple(ids2) or (None,)])), internal=True)) elif right is not False: # determine ids2 in comodel |
