Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
3922 Tampilan

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
Buang

did you find any solution please ?

Penulis

No, not right now.

Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
0
Sep 24
1790
1
Mei 24
3489
1
Apr 24
27455
2
Des 23
60282
1
Des 22
2434