From 4f1dbde8d595fc3c977401e364adac3e50c94296 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Mon, 5 May 2014 14:38:52 +0200 Subject: [PATCH] [FIX] mail: attachments present for first recipient, but not for the others attachments should be an array and not a generator [x for x in y] instead of (x for x in y) bzr revid: dle@openerp.com-20140505123852-kjc6z0npiot9c54l --- addons/mail/mail_mail.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/mail/mail_mail.py b/addons/mail/mail_mail.py index 0bd15374ee2..1cc033e8926 100644 --- a/addons/mail/mail_mail.py +++ b/addons/mail/mail_mail.py @@ -241,16 +241,16 @@ class mail_mail(osv.Model): """ ir_mail_server = self.pool.get('ir.mail_server') ir_attachment = self.pool['ir.attachment'] - + for mail in self.browse(cr, SUPERUSER_ID, ids, context=context): try: # load attachment binary data with a separate read(), as prefetching all # `datas` (binary field) could bloat the browse cache, triggerring # soft/hard mem limits with temporary data. attachment_ids = [a.id for a in mail.attachment_ids] - attachments = ((a['datas_fname'], base64.b64decode(a['datas'])) - for a in ir_attachment.read(cr, uid, attachment_ids, - ['datas_fname', 'datas'])) + attachments = [(a['datas_fname'], base64.b64decode(a['datas'])) + for a in ir_attachment.read(cr, SUPERUSER_ID, attachment_ids, + ['datas_fname', 'datas'])] # specific behavior to customize the send email for notified partners email_list = [] if mail.email_to: