Skip to Content
Menu
This question has been flagged
1 Atsakyti
4574 Rodiniai

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,


Portretas
Atmesti
Best Answer

Try it:

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

Portretas
Atmesti
Autorius

Thanks, it works!

Related Posts Replies Rodiniai Veikla
4
geg. 23
10838
1
saus. 19
9806
0
spal. 17
3622
0
lapkr. 16
2879
0
spal. 16
5131