From 3e0279ac4a41ac78720a128d9f9bef5da4ff30b2 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Thu, 15 Mar 2012 16:55:12 +0100 Subject: [PATCH] [FIX] email_template: attachments were not being sent due to programming error bzr revid: odo@openerp.com-20120315155512-s76y2u3gz3awfy74 --- addons/email_template/email_template.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/email_template/email_template.py b/addons/email_template/email_template.py index 7fe5e683e61..65890764d59 100644 --- a/addons/email_template/email_template.py +++ b/addons/email_template/email_template.py @@ -393,6 +393,8 @@ class email_template(osv.osv): } context.pop('default_type', None) attachment_ids.append(ir_attachment.create(cr, uid, attachment_data, context=context)) + if attachment_ids: + mail_message.write(cr, uid, msg_id, {'attachment_ids': [(6, 0, attachment_ids)]}, context=context) if force_send: mail_message.send(cr, uid, [msg_id], context=context) return msg_id