跳至内容
菜单
此问题已终结
1 回复
3523 查看

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?


形象
丢弃

did you find any solution please ?

编写者

No, not right now.

最佳答案

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

形象
丢弃
相关帖文 回复 查看 活动
0
9月 24
1328
1
5月 24
3019
1
4月 24
26579
2
12月 23
59432
1
12月 22
2075