Reputation: 11
I'm trying to update the header of a report. This is the original code.
<img t-if="o.company_id.header" t-att-src="'data:image/png;base64,%s' % to_text(o.company_id.header)" style="max-width: 100%;"/>
I then changed it to this because I didn't understand what that line means.
<img src='/mymodule/static/src/img/header2.jpg' style="max-width: 100%;"/>
When i try to download the pdf the image or header is appearing as a tiny box instead of the whole image. When I change header2.jpg to a existing file like header.jpg it seems to work. I've cleared cache, restart the server, and upgrade the module but the new header(header2.jpg) doesn't seem to appear right. I'm fairly new to Odoo and I would really appreciate the help and explanation why this is happening.
Upvotes: 0
Views: 1018
Reputation: 1
The problem could be because of report.url in Settings -> Technical -> System Parameters -> Search for report.url and edit it to your http_port for example : key = report.url value = http://localhost:8069
Note : Try to add it if it don't exist in your system parameters, with your http_port
Upvotes: 0
Reputation: 725
Here you need to check with your image, because as I see odoo has it's binary data image and they are converting this binary to base64 png image, does that make sense?
However If you still need to use your own image in header than try to convert your image online with aspect ratio and download it with .png extension.
Hope this will helpl you,
Thanks.
Upvotes: 0