-
- Downloads
[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
Showing
- odoo/addons/base/res/res_partner.py 8 additions, 6 deletionsodoo/addons/base/res/res_partner.py
- odoo/addons/base/tests/__init__.py 1 addition, 0 deletionsodoo/addons/base/tests/__init__.py
- odoo/addons/base/tests/test_res_partner.py 19 additions, 0 deletionsodoo/addons/base/tests/test_res_partner.py
Loading
Please register or sign in to comment