Hello guys,
We are able to display the picture of a product template in a PDF report.
We are able to display the picture of a product variant in a PDF report.
But the width of the image of a product variant is uncontrollable in the PDF.
In the html version of the report, it is easy to control the width withs html or css.
But html and css doesn't work for product variant image in the PDF report.
But what is the trick to control the width of the picture of the product variant???
Look here, this cap is the picture of a product variant :
UPDATE #1
Here is our code to display the variant (product.product) image in the PDF.
<td>
<span t-if="order_line.product_id.image_variant">
<span t-field="order_line.product_id.image_variant" t-field-options="{"widget": "image", "class": "img-rounded"}" />
</span>
</td>
But the width is still uncontrollable.
UPDATE #2
May be I should store image_small in database for each product variant (in product.product)???
UPDATE #3
I have tried this code :
<img t-if="l.product_id.image_variant" t-att-src="'data:image/png;base64,%s' % l.product_id.image_variant" class="img-rounded" style="width:1cm; height:1cm;"/>
image is displayed but width and height still have no effects. Grrr!
UPDATE #4
IT WORKS NOW!!!!! THANKS ALL.
Somebody would have a idea for this?
Who did flag this post today almost a year later and for what reason?
My error for the flag. Sorry