def find_module(self, module_name, package_path):
module_parts = module_name.split('.')
- if len(module_parts) == 3 and module_name.startswith('openerp.modules.'):
+ if len(module_parts) == 3 and module_name.startswith('openerp.addons.'):
return self # We act as a loader too.
# TODO list of loadable modules can be cached instead of always
logger.warning("""
Ambiguous import: the OpenERP module `%s` is shadowed by another
module (available at %s).
- To import it, use `import openerp.modules.<module>.`.""" % (module_name, path))
+ To import it, use `import openerp.addons.<module>.`.""" % (module_name, path))
return
except ImportError, e:
# Using `import <module_name>` instead of
- # `import openerp.modules.<module_name>` is ugly but not harmful
+ # `import openerp.addons.<module_name>` is ugly but not harmful
# and kept for backward compatibility.
return self # We act as a loader too.
def load_module(self, module_name):
module_parts = module_name.split('.')
- if len(module_parts) == 3 and module_name.startswith('openerp.modules.'):
+ if len(module_parts) == 3 and module_name.startswith('openerp.addons.'):
module_part = module_parts[2]
if module_name in sys.modules:
return sys.modules[module_name]
is_shadowing = True
except ImportError, e:
# Using `import <module_name>` instead of
- # `import openerp.modules.<module_name>` is ugly but not harmful
+ # `import openerp.addons.<module_name>` is ugly but not harmful
# and kept for backward compatibility.
is_shadowing = False
mod = imp.load_module(module_name, f, path, descr)
if not is_shadowing:
sys.modules[module_part] = mod
- sys.modules['openerp.modules.' + module_part] = mod
+ sys.modules['openerp.addons.' + module_part] = mod
return mod
openerp.modules.module.initialize_sys_path()
super(MetaModel, self).__init__(name, bases, attrs)
return
- # The (OpenERP) module name can be in the `openerp.modules` namespace
+ # The (OpenERP) module name can be in the `openerp.addons` namespace
# or not. For instance module `sale` can be imported as
- # `openerp.modules.sale` (the good way) or `sale` (for backward
+ # `openerp.addons.sale` (the good way) or `sale` (for backward
# compatibility).
module_parts = self.__module__.split('.')
if len(module_parts) > 2 and module_parts[0] == 'openerp' and \
- module_parts[1] == 'modules':
+ module_parts[1] == 'addons':
module_name = self.__module__.split('.')[2]
else:
module_name = self.__module__.split('.')[0]