Skip to content
Snippets Groups Projects
Commit e10a4025 authored by Jorge Pinna Puissant's avatar Jorge Pinna Puissant Committed by fw-bot
Browse files

[FIX] base: debug assets in multi-website/multi-company


Before this commit, the assets were not found when the user is connected
in mode debug assets in a multi-website and multi-company. This occurs
because the attachments (assets) were created with the number of the
first website accessed, and cannot be loaded when trying to access the
second website.

The website_id is added in the creation of the views see:
09287027

Now, the attachments are created without the website number and is
shared between all the websites.

opw-2076768

closes odoo/odoo#37789

X-original-commit: 42eec88e
Signed-off-by: default avatarJorge Pinna Puissant (jpp) <jpp@odoo.com>
parent 934dd57b
No related branches found
No related tags found
No related merge requests found
......@@ -437,7 +437,7 @@ class AssetsBundle(object):
fname = os.path.basename(asset.url)
url = asset.html_url
with self.env.cr.savepoint():
self.env['ir.attachment'].sudo().create(dict(
self.env['ir.attachment'].sudo().with_context(not_force_website_id=True).create(dict(
datas=base64.b64encode(asset.content.encode('utf8')),
mimetype='text/css',
type='binary',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment