diff --git a/odoo/__init__.py b/odoo/__init__.py index f9bbbb69138fc..bae8fd04b6a61 100644 --- a/odoo/__init__.py +++ b/odoo/__init__.py @@ -10,10 +10,7 @@ #---------------------------------------------------------- import pkgutil import os.path -__path__ = [ - os.path.abspath(path) - for path in pkgutil.extend_path(__path__, __name__) -] +__path__ = pkgutil.extend_path(__path__, __name__) import sys MIN_PY_VERSION = (3, 7) diff --git a/odoo/addons/__init__.py b/odoo/addons/__init__.py deleted file mode 100644 index 56e3bd2d8758e..0000000000000 --- a/odoo/addons/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -""" Addons module. - -This module serves to contain all Odoo addons, across all configured addons -paths. For the code to manage those addons, see odoo.modules. - -Addons are made available under `odoo.addons` after -odoo.tools.config.parse_config() is called (so that the addons paths are -known). - -This module also conveniently reexports some symbols from odoo.modules. -Importing them from here is deprecated. - -""" -# make odoo.addons a namespace package, while keeping this __init__.py -# present, for python 2 compatibility -# https://packaging.python.org/guides/packaging-namespace-packages/ -import pkgutil -import os.path -__path__ = [ - os.path.abspath(path) - for path in pkgutil.extend_path(__path__, __name__) -] diff --git a/odoo/tools/misc.py b/odoo/tools/misc.py index 5dad940be5fca..290f3cfaf04ca 100644 --- a/odoo/tools/misc.py +++ b/odoo/tools/misc.py @@ -166,7 +166,7 @@ def file_path(file_path, filter_ext=('',), env=None): :raise ValueError: if the file doesn't have one of the supported extensions (`filter_ext`) """ root_path = os.path.abspath(config['root_path']) - addons_paths = odoo.addons.__path__ + [root_path] + addons_paths = list(odoo.addons.__path__) + [root_path] if env and hasattr(env.transaction, '__file_open_tmp_paths'): addons_paths += env.transaction.__file_open_tmp_paths is_abs = os.path.isabs(file_path)