I wrote a new web controller in a new odoo addon - something like that:
@http.route('/web/somefunction', type='http', auth="none")
def somefunction(self, redirect='/web', **kw):
# render domething
Now if I open the URL with the parameter session_id odoo throws me 404. I also set the database with the parameter db but I think there should be no problem with the database because I use auth in the route definition.
If I remove the session_id parameter the controller function is found and called.
I need to set the session_id because I want to change the id. Here I use the functionality of openerp/http.py (class: Root, function: setup_session).
Also I created the session first (in another function which redirects to the "somefunction" controller function:
new_session = http.root.session_store.new()
new_session.db = request.session.db # just a test
So I use the session id of new_session. In my opinion this should work.
Do you have any ideas?
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 9/29/15, 4:01 AM|
|Seen: 1196 times|
|Last updated: 10/22/15, 1:40 AM|