From 8ccfebb399ed0f7b2239e856716a98eda65252a3 Mon Sep 17 00:00:00 2001 From: Matthias Lotz Date: Mon, 7 Apr 2025 15:23:48 +0200 Subject: [PATCH] Deinstallation von vvow_einweisungen bei Installation --- post_init_hook.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/post_init_hook.py b/post_init_hook.py index faeca30..fd488ee 100644 --- a/post_init_hook.py +++ b/post_init_hook.py @@ -22,5 +22,14 @@ def run_migration(cr, registry): try: env['res.partner'].migrate_machine_access_from_old_fields() _logger.info("[OWS] Automatische Felder-Migration für Maschinenfreigaben in res.partner.") + except Exception as e: _logger.error(f"[OWS] Fehler bei automatischer Felder-Migration: {e}") + + try: + module = env['ir.module.module'].search([('name', '=', 'vvow_einweisungen')], limit=1) + if module and module.state != 'uninstalled': + _logger.info("[OWS] Deinstalliere altes Modul vvow_einweisungen...") + module.button_immediate_uninstall() + except Exception as e: + _logger.error(f"[OWS] Fehler bei deinstallieren von vvow_einweisungen: {e}") \ No newline at end of file