Browse Source

[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
pull/1408/head
Martin Trigaux 6 years ago
committed by Pedro M. Baeza
parent
commit
3a2f771605
  1. 1
      database_cleanup/models/purge_tables.py

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

Loading…
Cancel
Save