Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
2455 Lượt xem

Hello,

We use odoo 12 community,

I want add all image a product in sales report.

I used in below code:

<td class="text-center" width="30%" height="5%">
      <img t-attf-src="data:image/*;base64,{{p.product_id.image_small }}" style="width:100;height:40"/>
 </td>

   

but this code just display image field: image_medium not the images in the images tab.
please help me, Thanks.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

You should loop on the images field and then display the image.

<t foreach="p.image_ids" t-as="img">
<td class="text-center" width="30%" height="5%">
<img t-attf-src="data:image/*;base64,{{img.image}}" style="width:100;height:40"/>
</td>
</t>


Ảnh đại diện
Huỷ bỏ