跳至內容
選單
此問題已被標幟
2 回覆
3691 瀏覽次數

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;' />
頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
10月 22
5532
2
3月 21
8745
0
12月 20
3581
0
5月 20
2677
0
1月 20
2197