跳至內容
選單
此問題已被標幟
1 回覆
3511 瀏覽次數

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
1304
1
5月 24
2982
1
4月 24
26553
2
12月 23
59391
1
12月 22
2068