Skip to content

Commit

Permalink
[FIX] really uninstall modules and avoid a crash on cached data
Browse files Browse the repository at this point in the history
  • Loading branch information
hbrunn committed Aug 1, 2017
1 parent bf40673 commit 55fd3d5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion database_cleanup/models/purge_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down

0 comments on commit 55fd3d5

Please sign in to comment.