Odoo Help

1

qweb report ordered for also for a second field

By
Juan Vicente Pascual
on 5/24/16, 8:18 AM 497 views

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,


1
Isaac
On 5/24/16, 9:40 AM

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!

Juan Vicente Pascual
on 5/24/16, 9:48 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 5/24/16, 8:18 AM
Seen: 497 times
Last updated: 5/24/16, 9:48 AM