From 3af70c03a3f604289d4521132f2cf0628d462661 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Tue, 2 Aug 2016 12:55:43 +0200 Subject: [PATCH] [FIX] purge uninstalled uninstallable modules instead of deleting --- database_cleanup/model/purge_modules.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/database_cleanup/model/purge_modules.py b/database_cleanup/model/purge_modules.py index d371b5f05..e1fa84969 100644 --- a/database_cleanup/model/purge_modules.py +++ b/database_cleanup/model/purge_modules.py @@ -106,13 +106,18 @@ class CleanupPurgeWizardModule(orm.TransientModel): def find(self, cr, uid, context=None): module_pool = self.pool['ir.module.module'] + purge_line_pool = self.pool['cleanup.purge.line.module'] module_ids = module_pool.search(cr, uid, [], context=context) res = [] for module in module_pool.browse(cr, uid, module_ids, context=context): if get_module_path(module.name): continue if module.state == 'uninstalled': - module_pool.unlink(cr, uid, module.id, context=context) + purge_line_pool.purge( + cr, uid, [ + purge_line_pool.create( + cr, uid, {'name': module.name}, context=context), + ], context=context) continue res.append((0, 0, {'name': module.name}))