From b466c0cc8c7eef8c5198479c545a857fbb25a8ba Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Tue, 5 Sep 2017 20:00:15 +0200 Subject: [PATCH] [DEL] weird code --- database_cleanup/models/purge_modules.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/database_cleanup/models/purge_modules.py b/database_cleanup/models/purge_modules.py index fb8e0ad77..40776f68e 100644 --- a/database_cleanup/models/purge_modules.py +++ b/database_cleanup/models/purge_modules.py @@ -40,12 +40,7 @@ class CleanupPurgeLineModule(models.TransientModel): Uninstall modules upon manual confirmation, then reload the database. """ - if self: - objs = self - else: - objs = self.env['cleanup.purge.line.module']\ - .browse(self._context.get('active_ids')) - module_names = objs.filtered(lambda x: not x.purged).mapped('name') + module_names = self.filtered(lambda x: not x.purged).mapped('name') modules = self.env['ir.module.module'].search([ ('name', 'in', module_names) ]) @@ -57,7 +52,7 @@ class CleanupPurgeLineModule(models.TransientModel): ).button_immediate_uninstall() modules.refresh() modules.unlink() - return objs.write({'purged': True}) + return self.write({'purged': True}) class CleanupPurgeWizardModule(models.TransientModel):