In my Odoo 11 server addon module have a web controller that uses auth='none' to provide an API. I have constructed it per documentation and examples from Odoo code. I want it to be available for non-Odoo callers w/o a session. Here is the code
class MyController(http.Controller):
log.info('loading MyController class')
# route declaration example copied from Odoo codebase
# @http.route('/web/database/create', type='http', auth="none", methods=['POST'], csrf=False)
@http.route('/my_controller/event/', type='http', auth='none', methods=['POST'], csrf=False)
def index(self, **post):
return "Hello, world"
I know the class is being loaded because of the logging. The route declarations is copied from Odoo code that does get the route registered. Am I doing something wrong, or is this an Odoo bug? If it's me, how is the Odoo code managing to get its route entered into the nodb_routing_map?
Any solution would be most appreciated.
I should note that if the route is called from a browser with an active Odoo session then it is found and the decorated function gets executed. The problem is that auth='none' is documented as making the route always available, such as when there is no session or active DB. That is not happening in this case.