Skip to Content
मेन्यू
This question has been flagged
1 Reply
3703 Views

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
Discard

did you find any solution please ?

Author

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
Discard
Related Posts Replies Views Activity
0
सित॰ 24
1476
1
मई 24
3196
1
अप्रैल 24
26862
2
दिस॰ 23
59683
1
दिस॰ 22
2197