From 2ff76674d2daa469616b327f4a024f3850063992 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Tue, 14 Apr 2020 10:00:10 +0000 Subject: [PATCH] [FIX] web: style attachment company specific always in bytes Following https://github.com/odoo/odoo/pull/44393 Delete the qweb template `web.styles_company_report` Recompute company specific style by going into Settings > Configure Document Layout > change stuff and save Print a report, in HTML to get an human readable error (PDF rendering would just ignore the error) Before this commit, there was an error "could not get asset content" This was because the css asset created in db had a value of type string whereas it should have been the same type as b64encode (which is byte-like) After this commit, there is no error at rendering time closes #49456 closes odoo/odoo#49529 X-original-commit: 2a7e06663c1281f0cf75f72fc491bc2cc39ef81c Signed-off-by: Lucas Perais (lpe) --- addons/web/models/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/models/models.py b/addons/web/models/models.py index bb9a865f161..7a55026eb05 100644 --- a/addons/web/models/models.py +++ b/addons/web/models/models.py @@ -384,7 +384,7 @@ class ResCompany(models.Model): def _get_asset_style_b64(self): template_style = self.env.ref('web.styles_company_report', raise_if_not_found=False) if not template_style: - return '' + return b'' # One bundle for everyone, so this method # necessarily updates the style for every company at once company_ids = self.sudo().search([])