Browse Source

Merge pull request #489 from hbrunn/8.0-database_cleanup-purge_uninstalled

[FIX] purge uninstalled uninstallable modules instead of deleting
pull/518/head
Stefan Rijnhart (Opener) 8 years ago
committed by GitHub
parent
commit
e79f138f02
  1. 7
      database_cleanup/model/purge_modules.py

7
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}))

Loading…
Cancel
Save