From 55fd3d5eb3e19816d7baa3e9c87ee07cd8a4e6c3 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Wed, 2 Aug 2017 01:44:08 +0200 Subject: [PATCH] [FIX] really uninstall modules and avoid a crash on cached data --- database_cleanup/models/purge_modules.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/database_cleanup/models/purge_modules.py b/database_cleanup/models/purge_modules.py index bdfe3fcfa49..ac9276e2ce5 100644 --- a/database_cleanup/models/purge_modules.py +++ b/database_cleanup/models/purge_modules.py @@ -53,11 +53,12 @@ def purge(self): if not modules: return True self.logger.info('Purging modules %s', ', '.join(module_names)) - modules.button_uninstall() + modules.button_immediate_uninstall() # we need this commit because reloading the registry would roll back # our changes self.env.cr.commit() # pylint: disable=invalid-commit RegistryManager.new(self.env.cr.dbname, update_module=True) + modules.refresh() modules.unlink() return objs.write({'purged': True})