Odoo10之Controller

Odoo处理HTTP请求的接口用的Contoller类

模型位置:
2222323.png

处理http的所有方法:

333343434.png

例子1:自定义路径/test 返回字符串“Hello world".

  1. # -- coding: utf-8 --
  2. from odoo.http import Controller, route
  3. class testController(Controller):
  4. ​ @route(['/test'], type='http', auth='user', website=False)
  5. ​ def dashboard(self, **post):
  6. ​ return "Hello, world"
Last modification:January 8th, 2019 at 09:41 pm
If you think my article is useful to you, please feel free to appreciate

Leave a Comment