Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
4550 มุมมอง

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,


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Try it:

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

อวตาร
ละทิ้ง
ผู้เขียน

Thanks, it works!

Related Posts ตอบกลับ มุมมอง กิจกรรม
4
พ.ค. 23
10819
1
ม.ค. 19
9799
0
ต.ค. 17
3602
0
พ.ย. 16
2873
0
ต.ค. 16
5124