diff options
| author | Raphael Collet <rco@odoo.com> | 2017-04-06 15:27:21 +0200 |
|---|---|---|
| committer | Raphael Collet <rco@odoo.com> | 2017-04-06 16:46:46 +0200 |
| commit | 6595cfdf0c4ea64fd9271a06107cfa90297f246d (patch) | |
| tree | 350d693dc26bc216545938f37d3349a089638f2b /doc/reference/javascript.rst | |
| parent | 3c2065c89da757406f080d9252e2c3019c66e8c7 (diff) | |
[FIX] expression: avoid useless query when searching on x2many sub-field
Searching on a domain like `[('m2m.sub', operator, value)]` currently does
something like:
right_ids = comodel.search([('sub', operator, value)]).ids
table_ids = model.search([('m2m', 'in', right_ids)]).ids
and reduces the domain triple to `('id', 'in', table_ids)`.
The domain triple can actually be reduced to `('m2m', 'in', right_ids)`. With
this reduction, the search on the field `m2m` will be done as part of the main
query. And this will also enable the optimization of the former fix!
Diffstat (limited to 'doc/reference/javascript.rst')
0 files changed, 0 insertions, 0 deletions
