Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
3 Răspunsuri
15266 Vizualizări


is this code is working in Odoo12? because I tried to search in all modules and can't find anywhere that it would be used.


How can I display images from binary field in the Qweb report?


<img t-att-src="'data:image/svg ;base64,%s' % o.barcode"/>
Imagine profil
Abandonează
Autor Cel mai bun răspuns

Well your solutions not working for me and i found my own.


You have to use 

<img  t-att-src="image_data_uri(o.barcode)"


Imagine profil
Abandonează
Cel mai bun răspuns


t-attf-src="data:image/png;base64, #{o.barcode}"
or 
t-att-src="'data:image/png;base64,%s' % to_text(o.barcode)"

make sure `barcode` is binary field

Imagine profil
Abandonează
Cel mai bun răspuns

Hi Grf,

Try this: <img t-attf-src="data:image/*;base64,{{o.barcode}}"/>

I hope it will work for you

Regards

Haresh Kansara

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
2
oct. 22
5683
2
mar. 21
3848
2
mar. 21
8959
0
dec. 20
3745
0
mai 20
2841