diff options
| author | YSA (Openerp) <ysa@tinyerp.com> | 2011-02-04 11:48:19 +0530 |
|---|---|---|
| committer | YSA (Openerp) <ysa@tinyerp.com> | 2011-02-04 11:48:19 +0530 |
| commit | bbdac458fdbd5ece78fc674767177f91b045e4bc (patch) | |
| tree | e6d019dc4d5d638435b34f492c891f41bb1bd9e9 /addons/project/wizard/project_task_close.py | |
| parent | e9e229568be13dbc9d56f3057e81de7824ff6aec (diff) | |
[IMP] call email_send method of email.message object insted of tools.
bzr revid: ysa@tinyerp.com-20110204061819-bb3p94bs7og680je
Diffstat (limited to 'addons/project/wizard/project_task_close.py')
| -rw-r--r-- | addons/project/wizard/project_task_close.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/addons/project/wizard/project_task_close.py b/addons/project/wizard/project_task_close.py index 7091f466e2c..5f0bad6f4da 100644 --- a/addons/project/wizard/project_task_close.py +++ b/addons/project/wizard/project_task_close.py @@ -45,13 +45,13 @@ class project_task_close(osv.osv_memory): context = {} record_id = context and context.get('active_id', False) or False task_pool = self.pool.get('project.task') - + res = super(project_task_close, self).default_get(cr, uid, fields, context=context) task = task_pool.browse(cr, uid, record_id, context=context) project = task.project_id manager = project.user_id or False partner = task.partner_id or task.project_id.partner_id - + if 'description' in fields: res.update({'description': task.description or False}) if 'manager_warn' in fields: @@ -67,7 +67,8 @@ class project_task_close(osv.osv_memory): def send(self, cr, uid, ids, context=None): if context is None: context = {} - + + email_message_obj = self.pool.get('email.message') task_pool = self.pool.get('project.task') task_id = context.get('active_id', False) if not task_id: @@ -106,7 +107,7 @@ class project_task_close(osv.osv_memory): to_adr.append(data.manager_email) if data.partner_warn and data.partner_email: to_adr.append(data.partner_email) - mail_id = tools.email_send(from_adr, to_adr, subject, tools.ustr(body), email_bcc=[from_adr]) + mail_id = email_message_obj.email_send(from_adr, to_adr, subject, tools.ustr(body), model='project.task.close', email_bcc=[from_adr]) if not mail_id: raise osv.except_osv(_('Error'), _("Couldn't send mail! Check the email ids and smtp configuration settings")) return {} |
