Skip to Content
Menu
This question has been flagged
1 Reply
1419 Views

So I have made some of my own customisation inside invoice print layout, only thing left is to add a SL number for the orderline since default one does not have it. How can I iterate a count variable for the same inside this for loop of the template.


<t t-foreach="o.invoice_line_ids>

Avatar
Discard
Best Answer

Hi,

Set a count variable before the for loop like this

<t t-set="count" t-value="1"/>

Now inside the for loop, you can show the count variable

<span t-esc="count"/>

And just after t-esc you can increment the value by adding this line within loop

<t t-set="count" t-value="count + 1"/>

Avatar
Discard
Author

Okay this works, thanks for the suggestion.