odoo_dev 开发培训作业:图书管理系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
402B

  1. from odoo import http
  2. from odoo.addons.car_app.controllers.main import Cars
  3. class Driver(Cars):
  4. @http.route()
  5. def list(self, **kwargs):
  6. response = super().list(**kwargs)
  7. if kwargs.get('available'):
  8. Car = http.request.env['car.data']
  9. cars = Car.search([('is_available', '=', True)])
  10. response.qcontext['drivers'] = cars
  11. return response
上海开阖软件有限公司 沪ICP备12045867号-1