跳至内容
菜单
此问题已终结
1 回复
4565 查看

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!

相关帖文 回复 查看 活动
4
5月 23
10827
1
1月 19
9803
0
10月 17
3608
0
11月 16
2875
0
10月 16
5125