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

I am trying to run a for loop in the email template of Odoo 15 and it is not working.



     % for line in object.purchase_id.order_line:
        

            
            
${line.product_qty}

        

     % endfor

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

Hello Golam Mostafa,

Hope you are doing Well.

For running the for loop for email template in odoo 15 has been changed. 

Find Code in Comment. 

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

อวตาร
ละทิ้ง

So for running the loop you can use the reference code below:

<tr t-foreach="object.lines" t-as="line">
<td><span t-field="line.product_id.name"/></td>
<td><span t-field="line.qty"/></td>
<td><span t-field="line.price_unit"/></td>
<td><span t-field="line.price_subtotal_incl"/></td>
</tr>

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ต.ค. 21
2344
2
ม.ค. 24
4263
Problem with email template (SOLVED) แก้ไขแล้ว
2
ม.ค. 24
9944
force send email in odoo แก้ไขแล้ว
2
ธ.ค. 22
5311
1
มี.ค. 21
9496