Browse Source
[FIX] really uninstall modules and avoid a crash on cached data
pull/894/head
Holger Brunn
8 years ago
No known key found for this signature in database
GPG Key ID: 1C9760FECA3AE18
1 changed files with
2 additions and
1 deletions
-
database_cleanup/models/purge_modules.py
|
|
@ -53,11 +53,12 @@ class CleanupPurgeLineModule(models.TransientModel): |
|
|
|
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}) |
|
|
|
|
|
|
|