In this blog we will explain how to order recordset in odoo with the search() function
So let us say we have object "student.student" and we have to build function that must return all student with age = 12 years and sort the ids with the id of the record, so we can build it as bellow
def student_filter(self):
student_ids = self.env['student.student'].search([(' age','=',12)], order='id')
return student_ids
No comments:
Post a Comment