How can I filter and return a sorted list from a set of records choosing which field to sort from using filter() and sort() function in Odoo?
Try this one
records.filtered(lambda r: r.company_id == user.company_id).sorted(key=lambda r: r.name)