콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
3 답글
14632 화면


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
5173
2
3월 21
3241
2
3월 21
8193
0
12월 20
3282
0
5월 20
2399