Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
1 Svar
3606 Visninger

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
Kassér

did you find any solution please ?

Forfatter

No, not right now.

Bedste svar

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
Kassér
Related Posts Besvarelser Visninger Aktivitet
0
sep. 24
1401
1
maj 24
3121
1
apr. 24
26723
2
dec. 23
59602
1
dec. 22
2131