Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
1 Responder
3506 Visualizações

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
Cancelar

did you find any solution please ?

Autor

No, not right now.

Melhor resposta

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
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
0
set. 24
1291
1
mai. 24
2969
1
abr. 24
26533
2
dez. 23
59378
1
dez. 22
2065