summaryrefslogtreecommitdiff
path: root/addons/hr_evaluation
diff options
context:
space:
mode:
authorOlivier Dony <odo@openerp.com>2011-08-22 19:16:59 +0200
committerOlivier Dony <odo@openerp.com>2011-08-22 19:16:59 +0200
commit8f9f45ea948d1ffecb79601e860d522fc6686c2d (patch)
treea789d72a67cef289e770323aaf45c158579ecc6c /addons/hr_evaluation
parent50507512cbaf6d0119a29943c9ca85deb4057404 (diff)
[IMP] all: next pass of review/renaming for new mail API
bzr revid: odo@openerp.com-20110822171659-zxho36a6n628i10q
Diffstat (limited to 'addons/hr_evaluation')
-rw-r--r--addons/hr_evaluation/hr_evaluation.py4
-rw-r--r--addons/hr_evaluation/hr_evaluation_view.xml2
-rw-r--r--addons/hr_evaluation/wizard/email_compose_message.py9
-rw-r--r--addons/hr_evaluation/wizard/hr_evaluation_mail.py10
4 files changed, 11 insertions, 14 deletions
diff --git a/addons/hr_evaluation/hr_evaluation.py b/addons/hr_evaluation/hr_evaluation.py
index 6455b72837a..7634052704c 100644
--- a/addons/hr_evaluation/hr_evaluation.py
+++ b/addons/hr_evaluation/hr_evaluation.py
@@ -192,7 +192,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')
+ mail_message = self.pool.get('mail.message')
hr_eval_inter_obj = self.pool.get('hr.evaluation.interview')
if context is None:
context = {}
@@ -229,7 +229,7 @@ class hr_evaluation(osv.osv):
sub = phase.email_subject
dest = [child.work_email]
if dest:
- email_message_obj.schedule_with_attach(cr, uid, evaluation.employee_id.work_email, dest, sub, body, model='hr_evaluation.evaluation')
+ mail_message.schedule_with_attach(cr, uid, evaluation.employee_id.work_email, dest, sub, body, context=context)
self.write(cr, uid, ids, {'state':'wait'}, context=context)
return True
diff --git a/addons/hr_evaluation/hr_evaluation_view.xml b/addons/hr_evaluation/hr_evaluation_view.xml
index 723036f2269..3b1a4ce94e9 100644
--- a/addons/hr_evaluation/hr_evaluation_view.xml
+++ b/addons/hr_evaluation/hr_evaluation_view.xml
@@ -412,7 +412,7 @@
<!-- Email Compose message Action-->
<act_window
id="evaluation_reminders" name="Evaluation Reminders"
- res_model="email.compose.message"
+ res_model="mail.compose.message"
src_model="hr.evaluation.interview"
view_type="form" view_mode="form"
target="new" multi="True"
diff --git a/addons/hr_evaluation/wizard/email_compose_message.py b/addons/hr_evaluation/wizard/email_compose_message.py
index c8e055928f6..7b4c1b69164 100644
--- a/addons/hr_evaluation/wizard/email_compose_message.py
+++ b/addons/hr_evaluation/wizard/email_compose_message.py
@@ -24,8 +24,8 @@ from osv import fields
import tools
from tools.translate import _
-class email_compose_message(osv.osv_memory):
- _inherit = 'email.compose.message'
+class mail_compose_message(osv.osv_memory):
+ _inherit = 'mail.compose.message'
def get_value(self, cr, uid, model, resource_id, context=None):
'''
@@ -37,7 +37,7 @@ class email_compose_message(osv.osv_memory):
'''
if context is None:
context = {}
- result = super(email_compose_message, self).get_value(cr, uid, model, resource_id, context=context)
+ result = super(mail_compose_message, self).get_value(cr, uid, model, resource_id, context=context)
if model == 'hr.evaluation.interview' and resource_id:
model_pool = self.pool.get(model)
record_data = model_pool.browse(cr, uid, resource_id, context)
@@ -47,7 +47,7 @@ class email_compose_message(osv.osv_memory):
'email_from': tools.config.get('email_from',''),
'email_to': record_data.user_to_review_id.work_email or False,
'subject': _("Reminder to fill up Survey"),
- 'body': msg,
+ 'body_text': msg,
'res_id': resource_id,
'model': model,
'email_cc': False,
@@ -56,6 +56,5 @@ class email_compose_message(osv.osv_memory):
})
return result
-email_compose_message()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_evaluation/wizard/hr_evaluation_mail.py b/addons/hr_evaluation/wizard/hr_evaluation_mail.py
index 37696ad465b..35c54a4cca3 100644
--- a/addons/hr_evaluation/wizard/hr_evaluation_mail.py
+++ b/addons/hr_evaluation/wizard/hr_evaluation_mail.py
@@ -23,22 +23,20 @@ import tools
class hr_evaluation_reminder(osv.osv_memory):
_name = "hr.evaluation.reminder"
- _description = "Sends Reminders to employess to fill the evaluations"
+ _description = "Sends Reminders to employees to fill the evaluations"
_columns = {
'evaluation_id': fields.many2one('hr.evaluation.interview', 'Interview', required=True)
}
def send_mail(self, cr, uid, ids, context=None):
- email_message_obj = self.pool.get('email.message')
+ mail_message = self.pool.get('mail.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)
- email_message_obj.schedule_with_attach(cr, uid, tools.config['email_from'], [current_interview.user_to_review_id.work_email],\
- 'Reminder to fill up Survey', msg, model='hr.evaluation.reminder')
+ mail_message.schedule_with_attach(cr, uid, tools.config['email_from'], [current_interview.user_to_review_id.work_email],\
+ 'Reminder to fill up Survey', msg, context=context)
return {'type': 'ir.actions.act_window_close'}
-hr_evaluation_reminder()
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: