diff --git a/odoo/addons/base/models/ir_module.py b/odoo/addons/base/models/ir_module.py index 57cbe796014..35d7bdd6313 100644 --- a/odoo/addons/base/models/ir_module.py +++ b/odoo/addons/base/models/ir_module.py @@ -177,8 +177,10 @@ class Module(models.Model): if not module.name: module.description_html = False continue - path = modules.get_module_resource(module.name, 'static/description/index.html') - if path: + module_path = modules.get_module_path(module.name, display_warning=False) # avoid to log warning for fake community module + if module_path: + path = modules.check_resource_path(module_path, 'static/description/index.html') + if module_path and path: with tools.file_open(path, 'rb') as desc_file: doc = desc_file.read() html = lxml.html.document_fromstring(doc) diff --git a/odoo/modules/__init__.py b/odoo/modules/__init__.py index b223df99280..3a754a4e171 100644 --- a/odoo/modules/__init__.py +++ b/odoo/modules/__init__.py @@ -17,6 +17,7 @@ from odoo.modules.module import ( get_modules_with_version, get_resource_from_path, get_resource_path, + check_resource_path, initialize_sys_path, load_information_from_description_file, load_openerp_module, diff --git a/odoo/modules/module.py b/odoo/modules/module.py index 6b7065a05ad..992fcf7b073 100644 --- a/odoo/modules/module.py +++ b/odoo/modules/module.py @@ -191,12 +191,14 @@ def get_resource_path(module, *args): TODO make it available inside on osv object (self.get_resource_path) """ mod_path = get_module_path(module) - if not mod_path: return False + if not mod_path: + return False + return check_resource_path(mod_path, *args) + +def check_resource_path(mod_path, *args): resource_path = opj(mod_path, *args) - if os.path.isdir(mod_path): - # the module is a directory - ignore zip behavior - if os.path.exists(resource_path): - return resource_path + if os.path.exists(resource_path): + return resource_path return False # backwards compatibility