Browse Source

[FIX] use exists query instead of huge in list

pull/158/head
Holger Brunn 10 years ago
parent
commit
aa70c7c4be
  1. 4
      database_cleanup/model/purge_data.py

4
database_cleanup/model/purge_data.py

@ -82,8 +82,8 @@ class CleanupPurgeWizardData(orm.TransientModel):
SELECT id FROM ir_model_data
WHERE model = %%s
AND res_id IS NOT NULL
AND res_id NOT IN (
SELECT id FROM %s)
AND NOT EXISTS (
SELECT id FROM %s WHERE id=ir_model_data.res_id)
""" % self.pool[model]._table, (model,))
data_ids += [data_row[0] for data_row in cr.fetchall()]
data_ids += data_pool.search(

Loading…
Cancel
Save