How to add images using QWeb?

109 views Asked by At

I've been spending so much time in to this and I still don't know why my new images won't appear in qweb's template/pdf. So this is the original code.

<img  src="/module/static/src/img/header.jpg" />

The original code works perfectly fine then I made a new header. Since I know I got the right path for my src all I needed to do is copy the new header to the same location as the old one and just change the file name right? Then when I finally change the file name to the new header like this

<img  src="/module/static/src/img/header2.jpg" />

It doesn't show my header2.jpg. I lowered the resolution to the point where's it's lower than the original file, added height and width to the style, clear cache, restart the server, check the spelling of the file and upgraded the module but my new header still won't appear.

Can someone explain why this is happening? Why qweb won't load my new images but seems perfectly fine when using the old ones?

1

There are 1 answers

0
Khay Leng On
  1. Create a binary variable for the image in the model whose data is used in QWeb.
  2. Use the variable in your report.

For example, if your QWeb report is of stock.picking, then create a binary variable in stock.picking and upload the image via UI.

Or

If you just want to change the logo, then in setting > company > (you can upload a new header logo).