[IMP] Allow openerp.modules.load_information_from_description_file() to take an optional mod_path argument

bzr revid: fme@openerp.com-20140319085708-prrs0m4gjvuu4o86
This commit is contained in:
Fabien Meghazi
2014-03-19 09:57:08 +01:00
parent 46cfd8940f
commit 14c3ffcb39
+5 -3
View File
@@ -169,13 +169,15 @@ def get_module_icon(module):
return ('/' + module + '/') + '/'.join(iconpath)
return '/base/' + '/'.join(iconpath)
def load_information_from_description_file(module):
def load_information_from_description_file(module, mod_path=None):
"""
:param module: The name of the module (sale, purchase, ...)
:param mod_path: Physical path of module, if not providedThe name of the module (sale, purchase, ...)
"""
terp_file = get_module_resource(module, '__openerp__.py')
mod_path = get_module_path(module)
if not mod_path:
mod_path = get_module_path(module)
terp_file = opj(mod_path, '__openerp__.py')
if terp_file:
info = {}
if os.path.isfile(terp_file):