[FIX] mail: Get attachment of a message with a SUPPERUSER_ID when the user can access...
authorChristophe Matthieu <chm@openerp.com>
Fri, 30 Nov 2012 13:43:56 +0000 (14:43 +0100)
committerChristophe Matthieu <chm@openerp.com>
Fri, 30 Nov 2012 13:43:56 +0000 (14:43 +0100)
bzr revid: chm@openerp.com-20121130134356-vbukzwgk2mj9dq51

addons/mail/mail_message.py

index 3273870..a0d1f61 100644 (file)
@@ -250,7 +250,7 @@ class mail_message(osv.Model):
         partner_tree = dict((partner[0], partner) for partner in partners)
 
         # 2. Attachments
-        attachments = ir_attachment_obj.read(cr, uid, list(attachment_ids), ['id', 'datas_fname'], context=context)
+        attachments = ir_attachment_obj.read(cr, SUPERUSER_ID, list(attachment_ids), ['id', 'datas_fname'], context=context)
         attachments_tree = dict((attachment['id'], {'id': attachment['id'], 'filename': attachment['datas_fname']}) for attachment in attachments)
 
         # 3. Update message dictionaries