Skip to content
Snippets Groups Projects
Commit 5ec4da2e authored by xmo-odoo's avatar xmo-odoo Committed by GitHub
Browse files

[IMP] base_module_import: ignore garbage directories


If the zipfile contains some garbage directories (e.g. leftover empty
directories from git, `__MACOSX` metadata folder, …) it seems
unnecessary to log an error, just skip the directory and don't mark it
as a proper / successful module.

closes odoo/odoo#31639

Signed-off-by: default avatarXavier Morel (xmo) <xmo@odoo.com>
parent d3c980e9
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,8 @@ class IrModule(models.Model):
installed_mods = [m.name for m in known_mods if m.state == 'installed']
terp = load_information_from_description_file(module, mod_path=path)
if not terp:
return False
values = self.get_values_from_terp(terp)
unmet_dependencies = set(terp['depends']).difference(installed_mods)
......@@ -110,8 +112,8 @@ class IrModule(models.Model):
try:
# assert mod_name.startswith('theme_')
path = opj(module_dir, mod_name)
self.import_module(mod_name, path, force=force)
success.append(mod_name)
if self.import_module(mod_name, path, force=force):
success.append(mod_name)
except Exception, e:
_logger.exception('Error while importing module')
errors[mod_name] = exception_to_unicode(e)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment