I'm running Odoo16 in the official Docker image.
I have a custom report inheriting from sale.report_saleorder. When I view a report in HTML, it's correct, with CSS applied. I can see report_assets_common and I can see my overrides that exist within style tags in my template.
However, when I view the report in PDF, the CSS is not applied, even the report_assets_common.
I have CSS that includes @font-face like so;
@font-face {
font-family: 'Raleway';
font-style: normal;
font-weight: 400;
src: url('/branding_nusa/static/fonts/Raleway-Light.ttf') format('truetype');
}
I also have an tag like so;
The image displays correctly, but the fonts only work on HTML.
I have report.url set to 'http://localhost:8069'
I know the resource is reachable from inside the container on the report.url because I can execute this from host;
docker exec -it odoo16 curl -I http://localhost:8069/branding_nusa/static/fonts/Raleway-Light.ttf
HTTP/1.0 200 OK
Content-Disposition: inline; filename=Raleway-Light.ttf
Content-Type: application/x-font-ttf
Content-Length: 182376
Last-Modified: Fri, 24 May 2024 03:25:15 GMT
Cache-Control: public, max-age=604800
Expires: Fri, 31 May 2024 08:52:47 GMT
ETag: "1716521115-182376-3913553847"
Date: Fri, 24 May 2024 08:52:47 GMT
Server: Werkzeug/1.0.1 Python/3.9.2
In the logs, I'm seeing this;
WARNING odoo16 odoo.addons.base.models.ir_actions_report: wkhtmltopdf: Exit with code 1 due to network error: ProtocolUnknownError
It's almost like the report.url isn't being prefixed to the resource URL.
My searching has only turned up the recommendations of setting report.url, or freezing the web.base.url.
Any ideas?
Apologies for the post being screwed up. It seems that the input is not escaped and every time I post, it gets screwed up in one way or another.