From 3a2f771605c8067c62778f4ae0ce0e26a2482e28 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Mon, 6 May 2019 16:47:15 +0200 Subject: [PATCH] [FIX] database_cleanup: filter on many2many fields Following odoo/odoo@54238c88e85d6e a Many2many may have no relation This avoids having a None record in the list (which is problematic with the NOT IN clause) https://wiki.postgresql.org/wiki/Don't_Do_This#Don.27t_use_NOT_IN --- database_cleanup/models/purge_tables.py | 1 + 1 file changed, 1 insertion(+) diff --git a/database_cleanup/models/purge_tables.py b/database_cleanup/models/purge_tables.py index 7ff1fec79..e9873af8f 100644 --- a/database_cleanup/models/purge_tables.py +++ b/database_cleanup/models/purge_tables.py @@ -93,6 +93,7 @@ class CleanupPurgeWizardTable(models.TransientModel): for column in model_pool._fields.values() if column.type == 'many2many' and (column.compute is None or column.store) + and column.relation ] self.env.cr.execute(