[IMP] Allow openerp.modules.load_information_from_description_file() to take an optio...
authorFabien Meghazi <fme@openerp.com>
Wed, 19 Mar 2014 08:57:08 +0000 (09:57 +0100)
committerFabien Meghazi <fme@openerp.com>
Wed, 19 Mar 2014 08:57:08 +0000 (09:57 +0100)
bzr revid: fme@openerp.com-20140319085708-prrs0m4gjvuu4o86

openerp/modules/module.py

index 8958813..b0b7e0a 100644 (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):