تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
3089 أدوات العرض

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
أكتوبر 21
2339
2
يناير 24
4253
2
يناير 24
9929
2
ديسمبر 22
5297
1
مارس 21
9487