[FIX] reintroduce modifications forward ported from 6.1 from Olivier Dony

bzr revid: abo@openerp.com-20121206140428-2v271z0ozdwl1yi3
This commit is contained in:
Antonin Bourguignon
2012-12-06 15:04:28 +01:00
parent 09e2b82331
commit e76573f945
2 changed files with 8 additions and 4 deletions
+4 -2
View File
@@ -767,10 +767,12 @@ class crm_lead(base_stage, format_address, osv.osv):
"""
#TODO this is a duplication of the handle_partner_assignation method of crm_phonecall
partner_ids = {}
# If a partner_id is given, force this partner for all elements
force_partner_id = partner_id
for lead in self.browse(cr, uid, ids, context=context):
# If the action is set to 'create' and no partner_id is set, create a new one
if action == 'create' and not partner_id:
partner_id = self._create_lead_partner(cr, uid, lead, context)
if action == 'create':
partner_id = force_partner_id or self._create_lead_partner(cr, uid, lead, context)
self._lead_set_partner(cr, uid, lead, partner_id, context=context)
partner_ids[lead.id] = partner_id
return partner_ids
+4 -2
View File
@@ -183,10 +183,12 @@ class crm_phonecall(base_state, osv.osv):
"""
#TODO this is a duplication of the handle_partner_assignation method of crm_lead
partner_ids = {}
# If a partner_id is given, force this partner for all elements
force_partner_id = partner_id
for call in self.browse(cr, uid, ids, context=context):
# If the action is set to 'create' and no partner_id is set, create a new one
if action == 'create' and not partner_id:
partner_id = self._call_create_partner(cr, uid, call, context)
if action == 'create':
partner_id = force_partner_id or self._call_create_partner(cr, uid, call, context=context)
self._call_create_partner_address(cr, uid, call, partner_id, context=context)
self._call_set_partner(cr, uid, [call.id], partner_id, context=context)
partner_ids[call.id] = partner_id