Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion database_cleanup/model/purge_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,18 @@ def default_get(self, cr, uid, fields, context=None):

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a style nitpick, but IMO the could would be more readable if the create was done in it's own instruction.

], context=context)
continue
res.append((0, 0, {'name': module.name}))

Expand Down