跳至內容
選單
此問題已被標幟
3 回覆
15328 瀏覽次數


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
5743
2
3月 21
3891
2
3月 21
9002
0
12月 20
3789
0
5月 20
2900