Skip to Content
Menú
This question has been flagged
1 Respondre
3503 Vistes

Hello everyone,

I have an image field

project_image = fields.Binary(string="Builder Logo", attachment=True, store=True)

I need to set this image field as a background image in qweb report. Can anyone please help me with this?


Avatar
Descartar

did you find any solution please ?

Autor

No, not right now.

Best Answer

Hi,

To add an image from the backend field as the background image for the Qweb is as follows:-

t-att-style="'background-image:url(\'/web/image/model_name/' + str(object.id) + '/image_field/\')'"

add this attribute to the main div element in the qweb report.

For example:-

<div class="page" t-att-style="'background-image:url(\'/web/image/sale.order/' + str(doc.id) + '/project_image/\')'">


Regards

Avatar
Descartar
Related Posts Respostes Vistes Activitat
0
de set. 24
1284
1
de maig 24
2965
1
d’abr. 24
26512
2
de des. 23
59365
1
de des. 22
2064