From b92082d49497e1d3ebea67269ed78379371b683a Mon Sep 17 00:00:00 2001 From: Nils Hamerlinck Date: Sat, 29 Oct 2022 07:26:14 +0000 Subject: [PATCH] [IMP] http: bind http.request before calling _get_session_and_dbname() on new request closes odoo/odoo#104605 X-original-commit: a4a71d34ffa60154f2764e1dfa5b0d688644603c Signed-off-by: Julien Castiaux --- odoo/http.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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: