From 45e88ddd7b43cdbc04d0e41773567c9d893b2d8b Mon Sep 17 00:00:00 2001 From: Hans Henrik Gabelgaard Date: Sun, 24 Nov 2024 09:48:35 +0100 Subject: [PATCH] [IMP] github_connector_odoo: Remove uninstallable If the module is uninstallable and module version exist, we drop it The default for installable is True --- .../models/github_repository_branch.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/github_connector_odoo/models/github_repository_branch.py b/github_connector_odoo/models/github_repository_branch.py index ac275d14..762bd6f5 100644 --- a/github_connector_odoo/models/github_repository_branch.py +++ b/github_connector_odoo/models/github_repository_branch.py @@ -233,11 +233,22 @@ def _analyze_module_name(self, path, module_name): odoo.addons.__path__.remove(path) # Create module version, if the module is installable # in the serie - if module_info.get("installable", False): + if module_info.get("installable", True): module_info["technical_name"] = module_name module_version_obj.create_or_update_from_manifest( module_info, self, full_module_path ) + else: + # Otherwise remove module version if exist + module_version = self.search( + [ + ("technical_name", "=", module_name), + ("repository_branch_id", "=", self.id), + ] + ) + if module_version: + module_version._process_clean_module_version() + except Exception as e: _logger.error( "Cannot process module with name %s, error " "is: %s", module_name, e