From 8699d4e8b6f9db7979baefd707be819e6389a0d9 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Thu, 16 Jun 2022 22:13:41 +0200 Subject: [PATCH] [FIX] check _exclude_directories in relative_path to avoid to fail when testing. test is done in a 'tests' folder, that is a excluded directory --- odoo_openupgrade_wizard/tools_odoo_module.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/odoo_openupgrade_wizard/tools_odoo_module.py b/odoo_openupgrade_wizard/tools_odoo_module.py index fdab1f6..f5de7d9 100644 --- a/odoo_openupgrade_wizard/tools_odoo_module.py +++ b/odoo_openupgrade_wizard/tools_odoo_module.py @@ -494,7 +494,8 @@ class OdooModuleVersion(object): for root, dirs, files in os.walk( self.addon_path / Path(self.odoo_module.name), followlinks=True ): - if set(Path(root).parts) & set(self._exclude_directories): + relative_path = os.path.relpath(Path(root), self.addon_path) + if set(Path(relative_path).parts) & set(self._exclude_directories): continue for name in files: if name in self._exclude_files: