[IMP] crm : Add arguments phone, contact_name, desc in schedule_phonecall function because of changes of field values in wizard to change on dependent models fields

bzr revid: ron@tinyerp.com-20111125062703-h5vq581a1ni93z7m
This commit is contained in:
ron@tinyerp.com 2011-11-25 11:57:03 +05:30
parent 03ac39321e
commit 0bb3d29d20
2 changed files with 4 additions and 4 deletions

View File

@ -666,7 +666,7 @@ class crm_lead(crm_case, osv.osv):
self.write(cr, uid, [lead_id], value, context=context)
return True
def schedule_phonecall(self, cr, uid, ids, schedule_time, call_summary, user_id=False, section_id=False, categ_id=False, action='schedule', context=None):
def schedule_phonecall(self, cr, uid, ids, schedule_time, call_summary, desc, phone, contact_name, user_id=False, section_id=False, categ_id=False, action='schedule', context=None):
"""
action :('schedule','Schedule a call'), ('log','Log a call')
"""
@ -687,12 +687,12 @@ class crm_lead(crm_case, osv.osv):
'opportunity_id' : lead.id,
'user_id' : user_id or False,
'categ_id' : categ_id or False,
'description' : lead.description or False,
'description' : desc or '',
'date' : schedule_time,
'section_id' : section_id or False,
'partner_id': lead.partner_id and lead.partner_id.id or False,
'partner_address_id': lead.partner_address_id and lead.partner_address_id.id or False,
'partner_phone' : lead.phone or (lead.partner_address_id and lead.partner_address_id.phone or False),
'partner_phone' : phone or lead.phone or (lead.partner_address_id and lead.partner_address_id.phone or False),
'partner_mobile' : lead.partner_address_id and lead.partner_address_id.mobile or False,
'priority': lead.priority,
}

View File

@ -71,7 +71,7 @@ class crm_opportunity2phonecall(osv.osv_memory):
opportunity = self.pool.get('crm.lead')
data = self.browse(cr, uid, ids, context=context)[0]
call_ids = opportunity.schedule_phonecall(cr, uid, opportunity_ids, data.date, data.name, \
data.user_id and data.user_id.id or False, \
data.note, data.phone, data.contact_name, data.user_id and data.user_id.id or False, \
data.section_id and data.section_id.id or False, \
data.categ_id and data.categ_id.id or False, \
action=data.action, context=context)