From 92a13688d0b71ae1217f222ce9f2bc4f0cde9e43 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 8d99db34..59a3fcc2 100644 --- a/github_connector_odoo/models/github_repository_branch.py +++ b/github_connector_odoo/models/github_repository_branch.py @@ -234,11 +234,22 @@ def _analyze_module_name(self, path, module_name): ) # 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