When should I use SQL Query or ORM Search Method to get better performance?
For instance:
Should I use this
query = """ select distinct license_plate_number from car_car where state not in ('cancel', 'sold') and license_plate_number = '{}'; """.format(license_plate_number) self.env.cr.execute(query) cars = self.env.cr.dictfetchall()
or this:
cars = self.search([ ('license_plate_number', '=', self.license_plate_number), ('state', 'not in', ('cancel', 'sold')) ])