Files
odoo_source/odoo/addons/__init__.py
T
Julien Castiaux 7ef68e4b0e [FIX] core: using absolute paths
Start odoo-bin using a tier module (like `python3 -m pdb odoo-bin`), the
odoo/addons __path__ contains the relative link to the modules instead
of the absolute link like when directly started (`python3 odoo-bin`).

This cause trouble importing modules because it reuses the relative path
from within other directories.

closes odoo/odoo#39182

X-original-commit: 941e051fc6b33e7a90400c77d63d589049b027a6
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2019-10-22 13:17:03 +00:00

26 lines
814 B
Python

# -*- 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__)
]