diff --git a/odoo/http.py b/odoo/http.py index a7f5b19847a..6d4e2c00603 100644 --- a/odoo/http.py +++ b/odoo/http.py @@ -1107,10 +1107,12 @@ class Request: self.dispatcher = _dispatchers['http'](self) # until we match #self.params = {} # set by the Dispatcher - self.session, self.db = self._get_session_and_dbname() self.registry = None self.env = None + def _post_init(self): + self.session, self.db = self._get_session_and_dbname() + def _get_session_and_dbname(self): # The session is explicit when it comes from the query-string or # the header. It is implicit when it comes from the cookie or @@ -1951,6 +1953,7 @@ class Application: werkzeug.datastructures.ImmutableOrderedMultiDict) request = Request(httprequest) _request_stack.push(request) + request._post_init() current_thread.url = httprequest.url try: