[Fix]: hr_recruitment: Phone call from applicant form view
lp bug: https://launchpad.net/bugs/720138 fixed bzr revid: rha@tinyerp.com-20110221132139-m71k4sih8ipk7c7e
This commit is contained in:
parent
91c1768528
commit
8f53734736
|
@ -51,10 +51,22 @@ class job2phonecall(osv.osv_memory):
|
|||
|
||||
def _get_note(self, cr, uid, context=None):
|
||||
case_obj = self.pool.get('hr.applicant')
|
||||
msg_obj = self.pool.get('mailgate.message')
|
||||
if context is None:
|
||||
context = {}
|
||||
case = case_obj.browse(cr, uid, context.get('active_id', False), context=context)
|
||||
return case.description or ''
|
||||
content = False
|
||||
msgs = False
|
||||
context_id = context and context.get('active_id', False) or False
|
||||
if context_id:
|
||||
case = case_obj.browse(cr, uid, context_id, context=context)
|
||||
if case and case.description:
|
||||
return case.description
|
||||
elif case and not case.description:
|
||||
msgs = msg_obj.search(cr, uid, [('model', '=', 'hr.applicant'), ('res_id', '=', case.id), ('email_from', '!=', ''), ('email_to', '!=', '')], limit=1)
|
||||
if msgs:
|
||||
content = msg_obj.browse(cr, uid, msgs[0], context=context).description
|
||||
return content
|
||||
return False
|
||||
|
||||
_defaults = {
|
||||
'user_id': _date_user,
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<newline />
|
||||
<field name='note' colspan="4"/>
|
||||
<newline />
|
||||
<field name='category_id'/>
|
||||
<field name='category_id' domain="[('object_id.model', '=', 'crm.phonecall')]"/>
|
||||
</group>
|
||||
<separator colspan="4"/>
|
||||
<group col="2" colspan="4">
|
||||
|
|
Loading…
Reference in New Issue