odoo_dev 开发培训作业:图书管理系统
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

20 lignes
635B

  1. from odoo import http
  2. from odoo.http import request
  3. class Main(http.Controller):
  4. @http.route('/checkouts', auth='user', website=True)
  5. def checkouts(self, **kwargs):
  6. Checkout = request.env['library.checkout']
  7. checkouts = Checkout.search([])
  8. return request.render(
  9. 'library_website.index',
  10. {'docs': checkouts}
  11. )
  12. @http.route('/checkout/<model("library.checkout"):doc>', auth='user', website=True)
  13. def checkout(self, doc, **kwargs):
  14. return http.request.render(
  15. 'library_website.checkout',
  16. { 'doc': doc }
  17. )
上海开阖软件有限公司 沪ICP备12045867号-1