|
- from odoo import http
- from odoo.addons.car_app.controllers.main import Cars
-
- class Driver(Cars):
- @http.route()
- def list(self, **kwargs):
- response = super().list(**kwargs)
- if kwargs.get('available'):
- Car = http.request.env['car.data']
- cars = Car.search([('is_available', '=', True)])
- response.qcontext['drivers'] = cars
- return response
|