From eabcce60f02e7aadb2fab5e0558936b5b39d87e6 Mon Sep 17 00:00:00 2001 From: Julien Castiaux Date: Wed, 9 Nov 2022 11:54:15 +0000 Subject: [PATCH] [FIX] core: wsgi application entrypoint moved The wsgi application entrypoint moved during the [httpocalypse]. Some clients don't use the odoo builtin wsgi server and have troubles upgrading from 15.0 to 16.0 because the `odoo.service.wsgi_server` module doesn't exist anymore. [httpocalypse]: https://github.com/odoo/odoo/pull/78857 closes odoo/odoo#106187 X-original-commit: 4e5d7d2e93fcd082bd1b3a9e76cedab85b46f456 Signed-off-by: Julien Castiaux --- odoo/service/__init__.py | 3 +++ odoo/service/wsgi_server.py | 11 +++++++++++ setup/odoo-wsgi.example.py | 5 ++--- 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 odoo/service/wsgi_server.py diff --git a/odoo/service/__init__.py b/odoo/service/__init__.py index 6d3c88697c4..5b2ff06dcb4 100644 --- a/odoo/service/__init__.py +++ b/odoo/service/__init__.py @@ -5,6 +5,9 @@ from . import db from . import model from . import server +# deprecated since 15.3 +from . import wsgi_server + #.apidoc title: RPC Services """ Classes of this module implement the network protocols that the diff --git a/odoo/service/wsgi_server.py b/odoo/service/wsgi_server.py new file mode 100644 index 00000000000..9229c3cf318 --- /dev/null +++ b/odoo/service/wsgi_server.py @@ -0,0 +1,11 @@ +import warnings +import odoo.http + + +def application(environ, start_response): + + warnings.warn("The WSGI application entrypoint moved from " + "odoo.service.wsgi_server.application to odoo.http.root " + "in 15.3.", + DeprecationWarning, stacklevel=1) + return odoo.http.root(environ, start_response) diff --git a/setup/odoo-wsgi.example.py b/setup/odoo-wsgi.example.py index 58b0d12653f..e6a8ff3a883 100644 --- a/setup/odoo-wsgi.example.py +++ b/setup/odoo-wsgi.example.py @@ -25,8 +25,7 @@ conf = odoo.tools.config # Path to the OpenERP Addons repository (comma-separated for # multiple locations) - -conf['addons_path'] = '../../addons/trunk,../../web/trunk/addons' +#conf['addons_path'] = './odoo/addons,./addons' # Optional database config if not using local socket #conf['db_name'] = 'mycompany' @@ -38,7 +37,7 @@ conf['addons_path'] = '../../addons/trunk,../../web/trunk/addons' #---------------------------------------------------------- # Generic WSGI handlers application #---------------------------------------------------------- -application = odoo.service.wsgi_server.application +application = odoo.http.root odoo.service.server.load_server_wide_modules()