[FIX] mail: when performing pure email mass mailing

attachments were not formatted as a m2m command but a list
of ids. This is now fixed.

bzr revid: tde@openerp.com-20131126095632-txuy00xc1cmqjqcn
This commit is contained in:
Thibault Delavallée 2013-11-26 10:56:32 +01:00
parent 7baee28221
commit 41ca7536e0
1 changed files with 4 additions and 0 deletions

View File

@ -260,6 +260,10 @@ class mail_compose_message(osv.TransientModel):
for res_id, mail_values in all_mail_values.iteritems():
if mass_mail_mode and not wizard.post:
# Attachments are still formatted as a list of ids, because message_post will process them
# We have to put them back as a m2m command if we want attachments to be sent
if mail_values.get('attachment_ids'):
mail_values['attachment_ids'] = [(4, id) for id in mail_values['attachment_ids']]
self.pool.get('mail.mail').create(cr, uid, mail_values, context=context)
else:
subtype = 'mail.mt_comment'