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

I want to show only the first invoice line the qweb report and skip the second one,

As you can see the invoice below


I want to skip the line in yellow


Please check the below code

https://drive.google.com/file/d/10Ot9Eh6iwNado5yEaz0Ze51Kx6B_cH0i/view?usp=share_link


Avatar
Discard
Best Answer

Hi,

If you need to print only the first line from the invoice lines, you can add an if condition inside the for loop to print only the first iteration.

In the code in the shared link, after this code:      , add an if condition to check whether it is first iteration, if yes, we will print else will skip.

                      <t t-foreach="lines" t-as="line">
<t t-if="line_index == 0">

t>
t>



Thanks

Avatar
Discard
Author

Thanks that worked

Related Posts Replies Views Activity
2
Dec 24
8749
0
Nov 23
3214
2
Jan 23
4582
1
Oct 22
5997
0
Jul 22
9