From b9fd1cae1448af71bb3c93a1b5412e1b2c39ff5c Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Tue, 4 Sep 2012 19:08:49 +0200 Subject: [PATCH] [FIX] hr_evaluation: attempt to fix deprecated schedule_with_attach bzr revid: odo@openerp.com-20120904170849-w4xdfuykz6ycor8v --- addons/hr_evaluation/hr_evaluation.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/addons/hr_evaluation/hr_evaluation.py b/addons/hr_evaluation/hr_evaluation.py index def21f2b169..3508dc36d49 100644 --- a/addons/hr_evaluation/hr_evaluation.py +++ b/addons/hr_evaluation/hr_evaluation.py @@ -228,9 +228,13 @@ class hr_evaluation(osv.osv): body = phase.mail_body % {'employee_name': child.name, 'user_signature': child.user_id.signature, 'eval_name': phase.survey_id.title, 'date': time.strftime('%Y-%m-%d'), 'time': time } sub = phase.email_subject - dest = [child.work_email] - if dest: - mail_message.schedule_with_attach(cr, uid, evaluation.employee_id.work_email, dest, sub, body, context=context) + if child.work_email: + vals = {'state': 'outgoing', + 'subject': sub, + 'body_html': '
%s
' % body, + 'email_to': child.work_email, + 'email_from': evaluation.employee_id.work_email} + self.pool.get('mail.mail').create(cr, uid, vals, context=context) self.write(cr, uid, ids, {'state':'wait'}, context=context) return True