From e8b28c02a03285ec3f00d7b73bb29c2f7f485cd4 Mon Sep 17 00:00:00 2001 From: Toufik Ben Jaa Date: Wed, 13 Feb 2019 13:48:33 +0000 Subject: [PATCH] [FIX] website: server images for `website_published` records - When a record has `website_published` field set at True the method `binary_content` on `ir.http` should bypass the access rules and always deserve the content. This wasn't the case due to a mistake on the code. The code is checking the access rules and may in some cases not return the content. closes odoo/odoo#31068 --- addons/website/models/ir_http.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website/models/ir_http.py b/addons/website/models/ir_http.py index be3085eb835..bfaa9c6fce6 100644 --- a/addons/website/models/ir_http.py +++ b/addons/website/models/ir_http.py @@ -250,7 +250,7 @@ class Http(models.AbstractModel): obj = self.env[model].browse(int(id)) if obj and 'website_published' in obj._fields: if self.env[obj._name].sudo().search([('id', '=', obj.id), ('website_published', '=', True)]): - self.sudo() + self = self.sudo() return super(Http, self).binary_content( xmlid=xmlid, model=model, id=id, field=field, unique=unique, filename=filename, filename_field=filename_field, download=download, mimetype=mimetype,