Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
3526 Widoki

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?


Awatar
Odrzuć

did you find any solution please ?

Autor

No, not right now.

Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
wrz 24
1331
1
maj 24
3024
1
kwi 24
26584
2
gru 23
59445
1
gru 22
2076