[FIX] email_template: attachments were not being sent due to programming error

bzr revid: odo@openerp.com-20120315155512-s76y2u3gz3awfy74
This commit is contained in:
Olivier Dony 2012-03-15 16:55:12 +01:00
parent 0284caa8f0
commit 3e0279ac4a
1 changed files with 2 additions and 0 deletions

View File

@ -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