Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
3601 Visualizzazioni

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
Abbandona

did you find any solution please ?

Autore

No, not right now.

Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
set 24
1395
1
mag 24
3117
1
apr 24
26708
2
dic 23
59588
1
dic 22
2127