Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
3 Antwoorden
15253 Weergaven


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"/>
Avatar
Annuleer
Auteur Beste antwoord

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)"


Avatar
Annuleer
Beste antwoord


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

Avatar
Annuleer
Beste antwoord

Hi Grf,

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

I hope it will work for you

Regards

Haresh Kansara

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
2
okt. 22
5674
2
mrt. 21
3847
2
mrt. 21
8947
0
dec. 20
3739
0
mei 20
2836