[FIX] Serve ir.attachment with SUPERUSER_ID

We are not supposed to have a user id here

bzr revid: fme@openerp.com-20140326184022-1hulv7t5y6vuvr9y
This commit is contained in:
Fabien Meghazi 2014-03-26 19:40:22 +01:00
parent a0bbbf75c3
commit b7fbef1241
1 changed files with 1 additions and 1 deletions

View 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']