[IMP] database_cleanup: Unlink with new cursor
Needed for purging payment providers which recompute module_statepull/2684/head
parent
62885e310d
commit
0d2fbc3ec1
|
@ -55,8 +55,8 @@ class CleanupPurgeLineModule(models.TransientModel):
|
||||||
to_remove += to_remove.downstream_dependencies()
|
to_remove += to_remove.downstream_dependencies()
|
||||||
to_remove.write({"state": "to remove"})
|
to_remove.write({"state": "to remove"})
|
||||||
installed.button_immediate_uninstall()
|
installed.button_immediate_uninstall()
|
||||||
modules.env.invalidate_all()
|
with self.env.registry.cursor() as new_cr:
|
||||||
modules.unlink()
|
self.env(cr=new_cr)["ir.module.module"].browse(modules.ids).unlink()
|
||||||
return self.write({"purged": True})
|
return self.write({"purged": True})
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue