跳至内容
菜单
此问题已终结
1 回复
3109 查看

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>

相关帖文 回复 查看 活动
0
10月 21
2345
2
1月 24
4265
2
1月 24
9947
2
12月 22
5313
1
3月 21
9500