Skip to Content
Menu
This question has been flagged
3 Replies
15256 Rodiniai


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"/>
Portretas
Atmesti
Autorius Best Answer

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


Portretas
Atmesti
Best Answer


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

Portretas
Atmesti
Best Answer

Hi Grf,

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

I hope it will work for you

Regards

Haresh Kansara

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
2
spal. 22
5675
2
kov. 21
3847
2
kov. 21
8948
0
gruod. 20
3739
0
geg. 20
2836