diff --git a/database_cleanup/models/purge_columns.py b/database_cleanup/models/purge_columns.py index 4b982117e..b8cc0d9ad 100644 --- a/database_cleanup/models/purge_columns.py +++ b/database_cleanup/models/purge_columns.py @@ -3,7 +3,6 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import _, api, fields, models from openerp.exceptions import UserError -from openerp.osv import fields as legacy_fields class CleanupPurgeLineColumn(models.TransientModel): @@ -71,7 +70,7 @@ class CleanupPurgeWizardColumn(models.TransientModel): for model_pool in model_pools for column in model_pool._columns if not (isinstance(model_pool._columns[column], - legacy_fields.function) and + fields.fields.function) and not model_pool._columns[column].store) ])) columns += models.MAGIC_COLUMNS diff --git a/database_cleanup/models/purge_data.py b/database_cleanup/models/purge_data.py index e66125200..638a24ff7 100644 --- a/database_cleanup/models/purge_data.py +++ b/database_cleanup/models/purge_data.py @@ -15,9 +15,7 @@ class CleanupPurgeLineData(models.TransientModel): @api.multi def purge(self): - """ - Unlink data entries upon manual confirmation. - """ + """Unlink data entries upon manual confirmation.""" to_unlink = self.filtered(lambda x: not x.purged and x.data_id) self.logger.info('Purging data entries: %s', to_unlink.mapped('name')) to_unlink.mapped('data_id').unlink() @@ -31,11 +29,9 @@ class CleanupPurgeWizardData(models.TransientModel): @api.model def find(self): - """ - Collect all rows from ir_model_data that refer + """Collect all rows from ir_model_data that refer to a nonexisting model, or to a nonexisting - row in the model's table. - """ + row in the model's table.""" res = [] data_ids = [] unknown_models = []