[ADD] partner: Modfiy the name of res_partner_address for adding the support partner_address

bzr revid: sbh@tinyerp.com-20100908122400-wuwvhxv0ux3irxzp
This commit is contained in:
sbh (Open ERP) 2010-09-08 17:54:00 +05:30
parent 73807c9465
commit a6a10c9245
1 changed files with 5 additions and 2 deletions

View File

@ -305,7 +305,10 @@ class res_partner_address(osv.osv):
if r['name'] and (r['city'] or r['country_id']):
addr += ', '
addr += (r['country_id'] and r['country_id'][1] or '') + ' ' + (r['city'] or '') + ' ' + (r['street'] or '')
res.append((r['id'], addr.strip() or '/'))
if context.get('contact_display', 'contact')=='partner_address':
res.append((r['id'], r['partner_id'][1] +','+ addr.strip() or '/'))
else:
res.append((r['id'], addr.strip() or '/'))
return res
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100):
@ -313,7 +316,7 @@ class res_partner_address(osv.osv):
args=[]
if not context:
context={}
if context.get('contact_display', 'contact')=='partner':
if context.get('contact_display', 'contact')=='partner ' or context.get('contact_display', 'contact')=='partner_address ' :
ids = self.search(cr, user, [('partner_id',operator,name)], limit=limit, context=context)
else:
if not name: