[IMP] crm: Create partner form lead section_id not set in partner
bzr revid: ron@tinyerp.com-20111123064238-c1m2xl7nluthnpdn
This commit is contained in:
parent
932c96a6c1
commit
3debb307be
|
@ -579,6 +579,7 @@ class crm_lead(crm_case, osv.osv):
|
|||
'name': lead.partner_name or lead.contact_name or lead.name,
|
||||
'user_id': lead.user_id.id,
|
||||
'comment': lead.description,
|
||||
'section_id': lead.section_id.id or False,
|
||||
'address': []
|
||||
})
|
||||
return partner_id
|
||||
|
@ -587,6 +588,7 @@ class crm_lead(crm_case, osv.osv):
|
|||
res = False
|
||||
res_partner = self.pool.get('res.partner')
|
||||
if partner_id:
|
||||
res_partner.write(cr, uid, partner_id, {'section_id': lead.section_id.id or False})
|
||||
contact_id = res_partner.address_get(cr, uid, [partner_id])['default']
|
||||
res = lead.write({'partner_id' : partner_id, 'partner_address_id': contact_id}, context=context)
|
||||
|
||||
|
|
Loading…
Reference in New Issue