diff options
| author | Thibault Delavallée <tde@odoo.com> | 2018-12-21 15:40:30 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2018-12-21 15:40:32 +0000 |
| commit | cc217569b7d45cca72e7a3d0d5c1580531443bb0 (patch) | |
| tree | ab23d83ae486d7cd7b08b9e5fde289f39520fed5 /addons/base_import_module/tests/test_module | |
| parent | 6bf8b25b70c9c967b5f9a658485167cb1f338b6f (diff) | |
[FIX] base: fix name_search on res_partner when searching on linked users
Currently name_search on res_partner holds code to be done by a customized SQL
query allowing to speedup the search [1]. However when dealing with given args
there may be a crash if there is a domain based on user_ids fields.
Indeed this field is defined as auto_join [2]. It means the result of get_sql
returns where parameters based on joined tables. Those tables are not available
in the from clause in the original query.
This commit fixes that issue by correctly taking the from_clause from get_sql.
That way joined tables are available. Small update of the query is necessary
as fields are now res_partner.{id/email/vat/reference} as there may be several
tables linked in the query.
A test has been added to avoid regression.
[1] See https://github.com/odoo/odoo/commit/05ec12692f99b69924765fd0ce384632547f03f9 for a recent modification
and implementation of this query, even if it exists since a looooong time
[2] See https://github.com/odoo/odoo/commit/db8203c27a21acdbcad2cf1c394b6fea3cf13688 for the auto_join addition
closes odoo/odoo#29827
Diffstat (limited to 'addons/base_import_module/tests/test_module')
0 files changed, 0 insertions, 0 deletions
