[IMP] import hook: correctly set the imported module __name__.

bzr revid: vmt@openerp.com-20120124102024-ziajbxfxjs1kyurv
This commit is contained in:
Vo Minh Thu 2012-01-24 11:20:24 +01:00
parent a6042ec08c
commit 4d77e87495
1 changed files with 1 additions and 1 deletions

View File

@ -135,7 +135,7 @@ To import it, use `import openerp.addons.<module>.`.""" % (module_name, path))
# Note: we don't support circular import.
f, path, descr = imp.find_module(module_part, ad_paths)
mod = imp.load_module(module_name, f, path, descr)
mod = imp.load_module('openerp.addons.' + module_part, f, path, descr)
if not is_shadowing:
sys.modules[module_part] = mod
sys.modules['openerp.addons.' + module_part] = mod