QWeb has an iteration directive foreach which take an expression returning the collection to iterate on, and a second parameter t-as providing the name to use for the "current item" of the iteration:
In <span> I access Image of product_id using pack.operation
You can select size of image like: image_small and image_medium
Sometimes you need to call a function from QWeb and get image. This code help me to read proper image field and print it with QWeb.
image_browse is a browse of id that send by get_image(id)
If you want to show an image from the database you can just use the image widget like this:
And if you want to show an image stored as a file:
Note: respect the order and the type of the quotes
For someone who lands here from Google... For dynamic images from the database, one can use
...where
o.image_field_name
is a dynamic field from the database/model. I prefer the<img/>
tag over a<span/>
for images.To show a static image, use plain HTML.
Note: alternate text attribute in an image does not add value in PDF reports. They don't show up when the image is missing, as in HTML.
<span>
I access Image of product_id using pack.operation