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

How to insert image that is attached inside some record. For example company logo that is attached to your company form. The path to it would be (if using from res.partner) object.company_id.logo. But using it like another field, just gives binary sequence. How to use it in a way that binary sequence shows normal image?

P.S. adding image from url is easy, but I need to add image from openerp itself.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Insert the tag in template

<p> <img src="data:image/png;base64,${object.company_id.logo}" style="width: 150px;height: 80px;" /> </p>

อวตาร
ละทิ้ง

Can you tell me how to add static image to the template?

You can add just like stated above.

There is a problem with a such type of image. Some email service or email clients doesn't show such images.

Is it working for odoo 9? I tried this in odoo 9 but in mail image is not loaded. It shows some broken icon.

คำตอบที่ดีที่สุด

<p> <img src="data:image/png;base64,${object.company_id.logo}" style="width: 150px;height: 80px;" /> </p>

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

This would be better way to get image on email template.

<img t-attf-src="data:image/*;base64,{{company.logo}}" t-att-alt="company.name"/>
อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ม.ค. 24
4295
Problem with email template (SOLVED) แก้ไขแล้ว
2
ม.ค. 24
9969
1
มี.ค. 21
9535
0
ม.ค. 19
7120
0
ก.ย. 17
2699