diff --git a/database_cleanup/model/purge_models.py b/database_cleanup/model/purge_models.py index 811da30fe..1a3f3234a 100644 --- a/database_cleanup/model/purge_models.py +++ b/database_cleanup/model/purge_models.py @@ -80,9 +80,14 @@ class CleanupPurgeLineModel(orm.TransientModel): cr, uid, constraint_ids, context=context) relation_ids = fields_pool.search( cr, uid, [('relation', '=', row[1])], context=context) - if relation_ids: - fields_pool.unlink(cr, uid, relation_ids, - context=local_context) + for relation in relation_ids: + try: + # Fails if the model on the target side + # cannot be instantiated + fields_pool.unlink(cr, uid, [relation], + context=local_context) + except AttributeError: + pass model_pool.unlink(cr, uid, [row[0]], context=local_context) line.write({'purged': True}) cr.commit() diff --git a/database_cleanup/model/purge_tables.py b/database_cleanup/model/purge_tables.py index 9b589e97b..9be69630e 100644 --- a/database_cleanup/model/purge_tables.py +++ b/database_cleanup/model/purge_tables.py @@ -88,7 +88,7 @@ class CleanupPurgeWizardTable(orm.TransientModel): res = super(CleanupPurgeWizardTable, self).default_get( cr, uid, fields, context=context) if 'name' in fields: - res['name'] = _('Purge modules') + res['name'] = _('Purge tables') return res def find(self, cr, uid, context=None):