[FIX] crm: convert to opportunity, avoid overwrite user defined action default
This commit is contained in:
parent
79e01f0f4d
commit
68f3ed6569
|
@ -66,7 +66,7 @@ class crm_lead2opportunity_partner(osv.osv_memory):
|
||||||
tomerge.extend(self._get_duplicated_leads(cr, uid, partner_id, email, include_lost=True, context=context))
|
tomerge.extend(self._get_duplicated_leads(cr, uid, partner_id, email, include_lost=True, context=context))
|
||||||
tomerge = list(set(tomerge))
|
tomerge = list(set(tomerge))
|
||||||
|
|
||||||
if 'action' in fields:
|
if 'action' in fields and not res.get('action'):
|
||||||
res.update({'action' : partner_id and 'exist' or 'create'})
|
res.update({'action' : partner_id and 'exist' or 'create'})
|
||||||
if 'partner_id' in fields:
|
if 'partner_id' in fields:
|
||||||
res.update({'partner_id' : partner_id})
|
res.update({'partner_id' : partner_id})
|
||||||
|
|
|
@ -89,7 +89,7 @@ class crm_partner_binding(osv.osv_memory):
|
||||||
res = super(crm_partner_binding, self).default_get(cr, uid, fields, context=context)
|
res = super(crm_partner_binding, self).default_get(cr, uid, fields, context=context)
|
||||||
partner_id = self._find_matching_partner(cr, uid, context=context)
|
partner_id = self._find_matching_partner(cr, uid, context=context)
|
||||||
|
|
||||||
if 'action' in fields:
|
if 'action' in fields and not res.get('action'):
|
||||||
res['action'] = partner_id and 'exist' or 'create'
|
res['action'] = partner_id and 'exist' or 'create'
|
||||||
if 'partner_id' in fields:
|
if 'partner_id' in fields:
|
||||||
res['partner_id'] = partner_id
|
res['partner_id'] = partner_id
|
||||||
|
|
Loading…
Reference in New Issue