From fcc23ccd49d85facbddf252d53dc7152c44cf685 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20-=20Le=20Filament?= <remi@le-filament.com> Date: Tue, 1 Apr 2025 09:36:41 +0200 Subject: [PATCH] [FIX] keep version for new module --- models/res_partner.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/models/res_partner.py b/models/res_partner.py index 994caff..ad0aaf9 100644 --- a/models/res_partner.py +++ b/models/res_partner.py @@ -57,13 +57,13 @@ class ResPartner(models.Model): if module.get("author_type") != "odoo": # Création du module if module.get("name") not in existing_modules.mapped("name"): - new_module = module + new_module = module.copy() new_module.pop("latest_version", False) module_id = existing_modules.create(new_module) # Mise à jour des versions else: module_id = existing_modules.filtered( - lambda m: m.name == module.get("name") + lambda m: m.name == module.get("name") # noqa: B023 ) module_update = ModuleVersion.search( [ @@ -97,7 +97,7 @@ class ResPartner(models.Model): ) if module_uninstalled: module_ids = partner.module_version_ids.filtered( - lambda m: m.module_id.name in module_uninstalled + lambda m: m.module_id.name in module_uninstalled # noqa: B023 ) module_ids.unlink() -- GitLab