Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
3 Odpovědi
15243 Zobrazení


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
Zrušit
Autor Nejlepší odpověď

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
Zrušit
Nejlepší odpověď


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
Zrušit
Nejlepší odpověď

Hi Grf,

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

I hope it will work for you

Regards

Haresh Kansara

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
říj 22
5663
2
bře 21
3847
2
bře 21
8945
0
pro 20
3733
0
kvě 20
2834