[IMP]: crm: Improvement in phonecall to opportuniy wizard
bzr revid: rpa@tinyerp.com-20100318103328-yogulp3rvdo2y98l
This commit is contained in:
parent
60e7b429d0
commit
e56f3c673c
|
@ -50,6 +50,7 @@ class crm_phonecall2opportunity(osv.osv_memory):
|
|||
@param context: A standard dictionary for contextual values
|
||||
|
||||
"""
|
||||
phonecall_obj = self.pool.get('crm.phonecall')
|
||||
record_id = context and context.get('active_id', False) or False
|
||||
case = phonecall_obj.browse(cr, uid, record_id, context=context)
|
||||
if case.state in ['done', 'cancel']:
|
||||
|
@ -136,12 +137,14 @@ class crm_phonecall2opportunity(osv.osv_memory):
|
|||
@return : default values of fields.
|
||||
"""
|
||||
record_id = context and context.get('active_id', False) or False
|
||||
res = super(crm_phonecall2opportunity, self).default_get(cr, uid, fields, context=context)
|
||||
|
||||
if record_id:
|
||||
phonecall = self.pool.get('crm.phonecall').browse(cr, uid, record_id, context=context)
|
||||
res = {
|
||||
'name': phonecall.name,
|
||||
'partner_id': phonecall.partner_id and phonecall.partner_id.id or False
|
||||
}
|
||||
if 'name' in fields:
|
||||
res.update({'name': phonecall.name})
|
||||
if 'partner_id' in fields:
|
||||
res.update({'partner_id': phonecall.partner_id and phonecall.partner_id.id or False})
|
||||
return res
|
||||
|
||||
crm_phonecall2opportunity()
|
||||
|
|
Loading…
Reference in New Issue