[IMP]: Improvement for partner address detail

bzr revid: ksa@tinyerp.co.in-20100722134318-dul90mzdpwhga4e7
This commit is contained in:
ksa (Open ERP) 2010-07-22 19:13:18 +05:30
parent e9ebdfa99d
commit 5fec172796
2 changed files with 14 additions and 6 deletions

View File

@ -114,19 +114,27 @@ class tinythunderbird_partner(osv.osv):
'email': test['email'],
'phone': test['phone'],
'mobile': test['mobile'],
'country': test['country_id'][1],
'city': test['city'],
'street': test['street'],
}
return res.items()
def thunderbird_createcontact1(self,cr,user,vals):
dictcreate = dict(vals)
add_obj=self.pool.get('res.partner.address')
partner_ids=add_obj.search(cr,user,[('name','=',dictcreate['name'])])
partner=add_obj.read(cr,user,partner_ids,['name'])
partner_ids=add_obj.search(cr,user,[('email','=',vals)])
if partner and partner[0]:
create_id = add_obj.create(cr, user, dictcreate)
return create_id
if partner_ids:
partner_ids = partner_ids[0]
partner=add_obj.read(cr,user,partner_ids)
dictcreate.update({'partner_id':partner['partner_id'][0],
'email':partner['email'],
'phone':partner['phone'],
'mobile':partner['mobile']})
create_id = add_obj.create(cr, user, dictcreate)
return create_id
def thunderbird_createpartner(self,cr,user,vals):
dictcreate = dict(vals)