summaryrefslogtreecommitdiff
path: root/addons/hr_evaluation
diff options
context:
space:
mode:
authorYSA (Openerp) <ysa@tinyerp.com>2011-02-04 11:48:19 +0530
committerYSA (Openerp) <ysa@tinyerp.com>2011-02-04 11:48:19 +0530
commitbbdac458fdbd5ece78fc674767177f91b045e4bc (patch)
treee6d019dc4d5d638435b34f492c891f41bb1bd9e9 /addons/hr_evaluation
parente9e229568be13dbc9d56f3057e81de7824ff6aec (diff)
[IMP] call email_send method of email.message object insted of tools.
bzr revid: ysa@tinyerp.com-20110204061819-bb3p94bs7og680je
Diffstat (limited to 'addons/hr_evaluation')
-rw-r--r--addons/hr_evaluation/hr_evaluation.py3
-rw-r--r--addons/hr_evaluation/wizard/hr_evaluation_mail.py5
2 files changed, 5 insertions, 3 deletions
diff --git a/addons/hr_evaluation/hr_evaluation.py b/addons/hr_evaluation/hr_evaluation.py
index 4a9a46920f5..f5d8e677e0c 100644
--- a/addons/hr_evaluation/hr_evaluation.py
+++ b/addons/hr_evaluation/hr_evaluation.py
@@ -193,6 +193,7 @@ class hr_evaluation(osv.osv):
return {'value': {'plan_id':evaluation_plan_id}}
def button_plan_in_progress(self, cr, uid, ids, context=None):
+ email_message_obj = self.pool.get('email.message')
hr_eval_inter_obj = self.pool.get('hr.evaluation.interview')
if context is None:
context = {}
@@ -229,7 +230,7 @@ class hr_evaluation(osv.osv):
sub = phase.email_subject
dest = [child.work_email]
if dest:
- tools.email_send(evaluation.employee_id.work_email, dest, sub, body)
+ email_message_obj.email_send(evaluation.employee_id.work_email, dest, sub, body, model='hr_evaluation.evaluation')
self.write(cr, uid, ids, {'state':'wait'}, context=context)
return True
diff --git a/addons/hr_evaluation/wizard/hr_evaluation_mail.py b/addons/hr_evaluation/wizard/hr_evaluation_mail.py
index 17ad7415cb5..c9f2ac15c54 100644
--- a/addons/hr_evaluation/wizard/hr_evaluation_mail.py
+++ b/addons/hr_evaluation/wizard/hr_evaluation_mail.py
@@ -29,13 +29,14 @@ class hr_evaluation_reminder(osv.osv_memory):
}
def send_mail(self, cr, uid, ids, context=None):
+ email_message_obj = self.pool.get('email.message')
hr_evaluation_interview_obj = self.pool.get('hr.evaluation.interview')
evaluation_data = self.read(cr, uid, ids, context=context)[0]
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)
+ email_message_obj.email_send(tools.config['email_from'], [current_interview.user_to_review_id.work_email],\
+ 'Reminder to fill up Survey', msg, model='hr.evaluation.reminder')
return {'type': 'ir.actions.act_window_close'}
hr_evaluation_reminder()