diff --git a/addons/hr_recruitment/wizard/hr_recruitment_phonecall.py b/addons/hr_recruitment/wizard/hr_recruitment_phonecall.py index ecb6a7cb3a4..f220f122c02 100644 --- a/addons/hr_recruitment/wizard/hr_recruitment_phonecall.py +++ b/addons/hr_recruitment/wizard/hr_recruitment_phonecall.py @@ -51,10 +51,15 @@ 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 = {} + content = False case = case_obj.browse(cr, uid, context.get('active_id', False), context=context) - return case.description or '' + 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 case.description or content or False _defaults = { 'user_id': _date_user, diff --git a/addons/hr_recruitment/wizard/hr_recruitment_phonecall_view.xml b/addons/hr_recruitment/wizard/hr_recruitment_phonecall_view.xml index 95fe9c83018..10329c6a856 100644 --- a/addons/hr_recruitment/wizard/hr_recruitment_phonecall_view.xml +++ b/addons/hr_recruitment/wizard/hr_recruitment_phonecall_view.xml @@ -16,7 +16,7 @@ - +