[FIX] Serve ir.attachment with SUPERUSER_ID
authorFabien Meghazi <fme@openerp.com>
Wed, 26 Mar 2014 18:40:22 +0000 (19:40 +0100)
committerFabien Meghazi <fme@openerp.com>
Wed, 26 Mar 2014 18:40:22 +0000 (19:40 +0100)
We are not supposed to have a user id here

bzr revid: fme@openerp.com-20140326184022-1hulv7t5y6vuvr9y

addons/website/models/ir_http.py

index 5459fe2..272e348 100644 (file)
@@ -102,7 +102,7 @@ class ir_http(orm.AbstractModel):
 
     def _serve_attachment(self):
         domain = [('type', '=', 'binary'), ('url', '=', request.httprequest.path)]
-        attach = self.pool['ir.attachment'].search_read(request.cr, request.uid, domain, ['__last_update', 'datas', 'mimetype'], context=request.context)
+        attach = self.pool['ir.attachment'].search_read(request.cr, openerp.SUPERUSER_ID, domain, ['__last_update', 'datas', 'mimetype'], context=request.context)
         if attach:
             wdate = attach[0]['__last_update']
             datas = attach[0]['datas']