Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
3800 Представления

this my code

<img src="/my_module/static/img/img.png" width="100%" height="100%"/>

but the image not show


Could anyone help me, please?

Аватар
Отменить
Лучший ответ

Hello,

Try this,

Your image should be saved inside yourmodule/static/src/img/image name

<img src='/module name/static/src/img/image name with extention' style="max-height: 45px;"/>

In case if you have stored your image in a binary field then use this,

<img t-attf-src="data:image/*;base64,{{o.field_name}}" style="max-height: 80px;max-width: 145px;padding:2px;" align="center"/>

Check this too https://www.odoo.com/forum/help-1/display-image-in-qweb-report-76746


Thanks

Аватар
Отменить
Лучший ответ

Try this,

<img t-attf-src="'/my_module/static/img/img.png'" width="100%" height="100%"/>

or

<img t-attf-src="data:image/jpg;base64,{{ model.some_logo }}" align="left" height="65" width="65" style='margin:0px;padding-top:0px;' />
Аватар
Отменить
Related Posts Ответы Просмотры Активность
2
окт. 22
5632
2
мар. 21
8882
0
дек. 20
3673
0
мая 20
2790
0
янв. 20
2278