[IMP] crm : when lead has already a customer assigned to it and we click on convert to opp, it should not propose to create new customer in that wizard, it should give option 'Link to an Existing Customer' with the customer assigned to that lead.

bzr revid: mdi@tinyerp.com-20120926051933-59ln6fw4q0uz6mvp
This commit is contained in:
Divyesh Makwana (Open ERP) 2012-09-26 10:49:33 +05:30
parent c4e443e0d6
commit acf3ddf809
1 changed files with 3 additions and 1 deletions

View File

@ -60,10 +60,12 @@ class crm_lead2partner(osv.osv_memory):
partner_ids = partner.search(cr, uid, [('email', '=', this.email_from)], context=context)
if partner_ids:
partner_id = partner_ids[0]
if this.partner_id and this.partner_name:
if not this.partner_id and this.partner_name:
partner_ids = partner.search(cr, uid, [('name', '=', this.partner_name)], context=context)
if partner_ids:
partner_id = partner_ids[0]
if this.partner_id:
partner_id = this.partner_id.id
return partner_id
def default_get(self, cr, uid, fields, context=None):