From 14c3ffcb39e860e0f893d2727b4129eeea87244d Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 19 Mar 2014 09:57:08 +0100 Subject: [PATCH] [IMP] Allow openerp.modules.load_information_from_description_file() to take an optional mod_path argument bzr revid: fme@openerp.com-20140319085708-prrs0m4gjvuu4o86 --- openerp/modules/module.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/openerp/modules/module.py b/openerp/modules/module.py index 8958813baa2..b0b7e0aeb94 100644 --- a/openerp/modules/module.py +++ b/openerp/modules/module.py @@ -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):