Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
3 Respostas
15305 Visualizações


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"/>
Avatar
Cancelar
Autor Melhor resposta

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


Avatar
Cancelar
Melhor resposta


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

Avatar
Cancelar
Melhor resposta

Hi Grf,

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

I hope it will work for you

Regards

Haresh Kansara

Avatar
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
2
out. 22
5725
2
mar. 21
3860
2
mar. 21
8970
0
dez. 20
3765
0
mai. 20
2856