Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
3598 Prikazi

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
Opusti

did you find any solution please ?

Avtor

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
Opusti
Related Posts Odgovori Prikazi Aktivnost
0
sep. 24
1386
1
maj 24
3111
1
apr. 24
26699
2
dec. 23
59584
1
dec. 22
2127