diff --git a/openerp-server b/openerp-server index 44ba179830d..c44e6909687 100755 --- a/openerp-server +++ b/openerp-server @@ -244,7 +244,7 @@ if __name__ == "__main__": 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 @@ -259,18 +259,18 @@ if __name__ == "__main__": logger.warning(""" Ambiguous import: the OpenERP module `%s` is shadowed by another module (available at %s). - To import it, use `import openerp.modules..`.""" % (module_name, path)) + To import it, use `import openerp.addons..`.""" % (module_name, path)) return except ImportError, e: # Using `import ` instead of - # `import openerp.modules.` is ugly but not harmful + # `import openerp.addons.` 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] @@ -286,7 +286,7 @@ if __name__ == "__main__": is_shadowing = True except ImportError, e: # Using `import ` instead of - # `import openerp.modules.` is ugly but not harmful + # `import openerp.addons.` is ugly but not harmful # and kept for backward compatibility. is_shadowing = False @@ -295,7 +295,7 @@ if __name__ == "__main__": 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() diff --git a/openerp/addons/__init__.py b/openerp/addons/__init__.py index 02a5c9aa0a7..9554e9bd850 100644 --- a/openerp/addons/__init__.py +++ b/openerp/addons/__init__.py @@ -25,7 +25,7 @@ This module serves to contain all OpenERP addons, across all configured addons paths. For the code to manage those addons, see openerp.modules. -Addons are made available under `openerp.modules` after +Addons are made available under `openerp.addons` after openerp.tools.config.parse_config() is called (so that the addons paths are known). diff --git a/openerp/modules/module.py b/openerp/modules/module.py index a5c432722ea..5c50384c2bc 100644 --- a/openerp/modules/module.py +++ b/openerp/modules/module.py @@ -314,7 +314,7 @@ def register_module_classes(m): try: zip_mod_path = mod_path + '.zip' if not os.path.isfile(zip_mod_path): - __import__('openerp.modules.' + m) + __import__('openerp.addons.' + m) else: zimp = zipimport.zipimporter(zip_mod_path) zimp.load_module(m) diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py index 23cc040af47..05da35a5aeb 100644 --- a/openerp/osv/orm.py +++ b/openerp/osv/orm.py @@ -608,13 +608,13 @@ class MetaModel(type): 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]