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
classHome(main.Home):
@http.route('/web/session/authenticate', type='json', auth="none" ,cors='*')defauthenticate(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)"