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

I'm trying to show the report lines orderred by two values, maturity_date and amount, how can i achieve it.

i'm doing

<tr t-foreach="o.line_ids.sorted(key=lambda b: b.ml_maturity_date )" t-as="line">

to order by maturity_date,

how can i add amount so it gets ordered first by maturity_date and those result also for amount.

Kind regards,


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

Try it:

<tr t-foreach="o.line_ids.sorted(key=lambda b: (b.ml_maturity_date, b.another_param))" t-as="line">

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

Thanks, it works!

Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 5 23
10837
1
thg 1 19
9806
0
thg 10 17
3620
0
thg 11 16
2877
0
thg 10 16
5131