[FIX] database_cleanup: filter on many2many fields

Following odoo/odoo@54238c88e8 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
pull/2684/head
Martin Trigaux 2019-05-06 16:47:15 +02:00 committed by Miika Nissi
parent f181991bed
commit 13c2a780b5
No known key found for this signature in database
GPG Key ID: B20DC9FCFAF92E7F
1 changed files with 1 additions and 0 deletions

View File

@ -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(