Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
2605 Lượt xem

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


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Tác giả

Thanks that worked

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 12 24
9091
0
thg 11 23
3432
2
thg 1 23
4748
1
thg 10 22
6235
0
thg 7 22
9