Hello everyone,
Based on the Odoo documentation for Odoo v12, there are 2 functions that helps me filter and sort lists.
1. filted() sample code:
records.filtered(lambda r: r.company_id == user.company_id)
The code above will allow me to filter records whose company is the current user's company
2. sorted() sample code:
records.sorted(key=lambda r: r.name)
The code above will allow me to sort records by name
My question is:
How can I filter and return a sorted list by choosing which field to sort from using filter() and sort() (or any other) function in Odoo?
Thank you all in advance
Best regards
Paulo