Skip to content Skip to sidebar Skip to footer

How Do I Do POST/GET Request From AJAX To Odoo 10 Custom Module Controller? (Blocked By CORS Policy)

I am using Odoo 10 with a custom module and I created this simple controller. It works fine when i visit http://127.0.0.1:8069/cmodule/cmodule from the browser. It shows the return

Solution 1:

While you are trying different things try simple authentication

import odoo.addons.web.controllers.main as main
class Home(main.Home):
    @http.route('/web/session/authenticate', type='json', auth="none" ,cors='*')
    def authenticate(self, db, login, password, base_location=None): 
    request.session.authenticate(db, login, password)
        return request.env['ir.http'].session_info()


I had the same error when accessing it from IOS but worked fine with postman this, this code worked fine, well you did every thing in this code but still


Post a Comment for "How Do I Do POST/GET Request From AJAX To Odoo 10 Custom Module Controller? (Blocked By CORS Policy)"