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"/>
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
2
Oct 22
|
4552 | ||
|
2
Mar 21
|
2510 | ||
|
2
Mar 21
|
7228 | ||
|
0
Dec 20
|
2696 | ||
|
0
May 20
|
1938 |