Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
4538 Visualizzazioni

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,


Avatar
Abbandona
Risposta migliore

Try it:

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

Avatar
Abbandona
Autore

Thanks, it works!

Post correlati Risposte Visualizzazioni Attività
4
mag 23
10811
1
gen 19
9796
0
ott 17
3598
0
nov 16
2873
0
ott 16
5123