[FIX] base, res_partner: fixed the name_search in order to propagate the right parameter to super() and to not use the '%' symbol if the operator is '='
bzr revid: qdp-launchpad@openerp.com-20120320154757-0o8q4pb2uch76su2
This commit is contained in:
parent
9bcfaf8d36
commit
e37b9a5df3
|
@ -294,11 +294,11 @@ class res_partner(osv.osv):
|
|||
args = []
|
||||
if name and operator in ('=', 'ilike', '=ilike', 'like'):
|
||||
# search on the name of the contacts and of its company
|
||||
name = '%' + name + '%'
|
||||
name2 = operator == '=' and name or '%' + name + '%'
|
||||
cr.execute('''SELECT partner.id FROM res_partner partner
|
||||
LEFT JOIN res_partner company ON partner.parent_id = company.id
|
||||
WHERE partner.name || ' (' || COALESCE(company.name,'') || ')'
|
||||
''' + operator + ''' %s ''', (name,))
|
||||
''' + operator + ''' %s ''', (name2,))
|
||||
ids = map(lambda x: x[0], cr.fetchall())
|
||||
if args:
|
||||
ids = self.search(cr, uid, [('id', 'in', ids)] + args, limit=limit, context=context)
|
||||
|
|
Loading…
Reference in New Issue