[Fix]: hr_recruitment: removed extra variables

bzr revid: rha@tinyerp.com-20110222063341-jyjs09707tigmuih
This commit is contained in:
Rifakat Haradwala (Open ERP) 2011-02-22 12:03:41 +05:30
parent c2771c8af2
commit e26f2976ba
1 changed files with 7 additions and 12 deletions

View File

@ -50,22 +50,17 @@ class job2phonecall(osv.osv_memory):
return categ_id and categ_id[0] or case.categ_id and case.categ_id.id or False
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 = {}
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:
if context.get('active_id'):
case = self.pool.get('hr.applicant').browse(cr, uid, context['active_id'], context=context)
if 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
else:
msg_ids = msg_obj.search(cr, uid, [('model', '=', 'hr.applicant'), ('res_id', '=', case.id), ('email_from', '!=', ''), ('email_to', '!=', '')], limit=1)
if msg_ids:
return msg_obj.browse(cr, uid, msg_ids[0], context=context).description
return False