"""
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: