Browse Source
[IMP] purge uninstalled unavailable modules in bulk
pull/1316/head
Holger Brunn
7 years ago
No known key found for this signature in database
GPG Key ID: 1C9760FECA3AE18
1 changed files with
5 additions and
2 deletions
-
database_cleanup/models/purge_modules.py
|
@ -63,16 +63,19 @@ class CleanupPurgeWizardModule(models.TransientModel): |
|
|
@api.model |
|
|
@api.model |
|
|
def find(self): |
|
|
def find(self): |
|
|
res = [] |
|
|
res = [] |
|
|
|
|
|
purge_lines = self.env['cleanup.purge.line.module'] |
|
|
for module in self.env['ir.module.module'].search([]): |
|
|
for module in self.env['ir.module.module'].search([]): |
|
|
if get_module_path(module.name): |
|
|
if get_module_path(module.name): |
|
|
continue |
|
|
continue |
|
|
if module.state == 'uninstalled': |
|
|
if module.state == 'uninstalled': |
|
|
self.env['cleanup.purge.line.module'].create({ |
|
|
|
|
|
|
|
|
purge_lines += self.env['cleanup.purge.line.module'].create({ |
|
|
'name': module.name, |
|
|
'name': module.name, |
|
|
}).purge() |
|
|
|
|
|
|
|
|
}) |
|
|
continue |
|
|
continue |
|
|
res.append((0, 0, {'name': module.name})) |
|
|
res.append((0, 0, {'name': module.name})) |
|
|
|
|
|
|
|
|
|
|
|
purge_lines.purge() |
|
|
|
|
|
|
|
|
if not res: |
|
|
if not res: |
|
|
raise UserError(_('No modules found to purge')) |
|
|
raise UserError(_('No modules found to purge')) |
|
|
return res |
|
|
return res |
|
|