Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
3857 มุมมอง

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
5711
2
มี.ค. 21
8969
0
ธ.ค. 20
3762
0
พ.ค. 20
2856
0
ม.ค. 20
2336