diff options
| author | Toufik Ben Jaa <tbe@odoo.com> | 2019-02-13 13:48:33 +0000 |
|---|---|---|
| committer | Toufik Ben Jaa <tbe@odoo.com> | 2019-02-13 13:48:33 +0000 |
| commit | e8b28c02a03285ec3f00d7b73bb29c2f7f485cd4 (patch) | |
| tree | 6f98dabaad3dbcd54d84470beea8977c6ad110a9 | |
| parent | 98e3ca4e671dbf45a4db9e730a46e65497e46df3 (diff) | |
[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
| -rw-r--r-- | addons/website/models/ir_http.py | 2 |
1 files changed, 1 insertions, 1 deletions
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, |
