コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
3612 ビュー

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
1411
1
5月 24
3137
1
4月 24
26730
2
12月 23
59612
1
12月 22
2136