跳至内容
菜单
此问题已终结
3 回复
15257 查看


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"/>
形象
丢弃
编写者 最佳答案

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


形象
丢弃
最佳答案


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

形象
丢弃
最佳答案

Hi Grf,

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

I hope it will work for you

Regards

Haresh Kansara

形象
丢弃
相关帖文 回复 查看 活动
2
10月 22
5677
2
3月 21
3847
2
3月 21
8951
0
12月 20
3740
0
5月 20
2836