[FIX] mail: Get attachment of a message with a SUPPERUSER_ID when the user can access to the message

bzr revid: chm@openerp.com-20121130134356-vbukzwgk2mj9dq51
This commit is contained in:
Christophe Matthieu
2012-11-30 14:43:56 +01:00
parent f12df4e8ea
commit 8d41ea91d8
+1 -1
View 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