summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Delavallée <tde@openerp.com>2013-04-22 12:21:14 +0200
committerThibault Delavallée <tde@openerp.com>2013-04-22 12:21:14 +0200
commit856083e2b4e07a98192bd1d31fe4d6cc2c141b27 (patch)
tree12078eaecb7734d31a151a0fd6164c323f05edae
parentef210bd48998fe1b91eb3916bcc6223e1b609580 (diff)
[FIX] email_template: fixed wrong res_id given to attachments in send_mail (should be a mail.message res_id, not a mail.mail res_id), to use the low-level attachments unlink.
bzr revid: tde@openerp.com-20130422102114-a179ylzpgu3g6vcr
-rw-r--r--addons/email_template/email_template.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/email_template/email_template.py b/addons/email_template/email_template.py
index a602a447867..356d903b03d 100644
--- a/addons/email_template/email_template.py
+++ b/addons/email_template/email_template.py
@@ -381,6 +381,7 @@ class email_template(osv.osv):
attachment_ids = values.pop('attachment_ids', [])
attachments = values.pop('attachments', [])
msg_id = mail_mail.create(cr, uid, values, context=context)
+ mail = mail_mail.browse(cr, uid, msg_id, context=context)
# manage attachments
for attachment in attachments:
@@ -389,7 +390,7 @@ class email_template(osv.osv):
'datas_fname': attachment[0],
'datas': attachment[1],
'res_model': 'mail.message',
- 'res_id': msg_id,
+ 'res_id': mail.mail_message_id.id,
}
context.pop('default_type', None)
attachment_ids.append(ir_attachment.create(cr, uid, attachment_data, context=context))