Files
odoo_source/odoo/addons/base/tests/__init__.py
T
Thibault Delavallée cc217569b7 [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
2018-12-21 15:40:32 +00:00

36 lines
755 B
Python

import test_acl
import test_api
import test_base
import test_basecase
import test_db_cursor
import test_expression
import test_float
import test_func
import test_ir_actions
import test_ir_attachment
import test_ir_http
import test_ir_filters
import test_ir_sequence
import test_ir_sequence_date_range
import test_ir_values
import test_mail
import test_menu
import test_mimetypes
import test_orm
import test_ormcache
import test_osv
import test_phase
import test_qweb
import test_res_config
import test_res_lang
import test_search
import test_translate
#import test_uninstall # loop
import test_user_has_group
import test_view_validation
import test_views
import test_xmlrpc
import test_res_partner
import test_res_partner_bank
import test_non_regression