Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
3 Відповіді
15299 Переглядів


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

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
2
жовт. 22
5700
2
бер. 21
3856
2
бер. 21
8967
0
груд. 20
3760
0
трав. 20
2856