|
|
@ -72,6 +72,7 @@ class CleanupPurgeWizardModule(models.TransientModel): |
|
|
|
@api.model |
|
|
|
def find(self): |
|
|
|
res = [] |
|
|
|
purge_lines = self.env['cleanup.purge.line.module'] |
|
|
|
IrModule = self.env['ir.module.module'] |
|
|
|
for module in IrModule.search( |
|
|
|
[ |
|
|
@ -82,12 +83,14 @@ class CleanupPurgeWizardModule(models.TransientModel): |
|
|
|
if get_module_path(module.name, display_warning=False): |
|
|
|
continue |
|
|
|
if module.state == 'uninstalled': |
|
|
|
self.env['cleanup.purge.line.module'].create({ |
|
|
|
purge_lines += self.env['cleanup.purge.line.module'].create({ |
|
|
|
'name': module.name, |
|
|
|
}).purge() |
|
|
|
}) |
|
|
|
continue |
|
|
|
res.append((0, 0, {'name': module.name})) |
|
|
|
|
|
|
|
purge_lines.purge() |
|
|
|
|
|
|
|
if not res: |
|
|
|
raise UserError(_('No modules found to purge')) |
|
|
|
return res |
|
|
|