diff --git a/addons/hr_evaluation/wizard/hr_evaluation_mail.py b/addons/hr_evaluation/wizard/hr_evaluation_mail.py index 576c782bfd8..3464c4beaee 100644 --- a/addons/hr_evaluation/wizard/hr_evaluation_mail.py +++ b/addons/hr_evaluation/wizard/hr_evaluation_mail.py @@ -29,14 +29,14 @@ class hr_evaluation_reminder(osv.osv_memory): } def send_mail(self, cr, uid, ids, context=None): - hr_evaluation_obj = self.pool.get('hr_evaluation.evaluation') + hr_evaluation_interview_obj = self.pool.get('hr.evaluation.interview') if context is None: context = {} evaluation_data = self.read(cr, uid, ids, context=context)[0] - for waiting_id in hr_evaluation_obj.browse(cr, uid, evaluation_data['evaluation_id'], context=context).survey_request_ids: - if waiting_id.state == "waiting_answer" and waiting_id.user_to_review_id.work_email : - msg = " Hello %s, \n\n Kindly post your response for %s survey. \n\n Thanks," %(waiting_id.user_to_review_id.name, waiting_id.survey_id.title) - tools.email_send(tools.config['email_from'], [waiting_id.user_to_review_id.work_email],\ + current_interview = hr_evaluation_interview_obj.browse(cr, uid, evaluation_data.get('evaluation_id')) + if current_interview.state == "waiting_answer" and current_interview.user_to_review_id.work_email : + msg = " Hello %s, \n\n Kindly post your response for '%s' survey interview. \n\n Thanks," %(current_interview.user_to_review_id.name, current_interview.survey_id.title) + tools.email_send(tools.config['email_from'], [current_interview.user_to_review_id.work_email],\ 'Reminder to fill up Survey', msg) return {'type': 'ir.actions.act_window_close'}