Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
3097 Zobrazení

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

Avatar
Zrušit
Nejlepší odpověď

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

Avatar
Zrušit

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 Odpovědi Zobrazení Aktivita
0
říj 21
2341
2
led 24
4256
2
led 24
9933
2
pro 22
5302
1
bře 21
9490