コンテンツへスキップ
メニュー
この質問にフラグが付けられました
3 返信
15302 ビュー


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
5711
2
3月 21
3857
2
3月 21
8969
0
12月 20
3762
0
5月 20
2856