Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
4230 Vistas

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
Descartar
Mejor respuesta

Try it:

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

Avatar
Descartar
Autor

Thanks, it works!

Publicaciones relacionadas Respuestas Vistas Actividad
4
may 23
9633
1
ene 19
8765
0
oct 17
2951
0
nov 16
2339
0
oct 16
4610