diff --git a/database_cleanup/model/purge_data.py b/database_cleanup/model/purge_data.py
index bcab2d832..f3e1b63cd 100644
--- a/database_cleanup/model/purge_data.py
+++ b/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(
diff --git a/database_cleanup/model/purge_wizard.py b/database_cleanup/model/purge_wizard.py
index 5003c4aef..8629eb0b3 100644
--- a/database_cleanup/model/purge_wizard.py
+++ b/database_cleanup/model/purge_wizard.py
@@ -26,6 +26,7 @@ from openerp.osv import orm, fields
class CleanupPurgeLine(orm.AbstractModel):
""" Abstract base class for the purge wizard lines """
_name = 'cleanup.purge.line'
+ _order = 'name'
_columns = {
'name': fields.char('Name', size=256, readonly=True),
'purged': fields.boolean('Purged', readonly=True),
diff --git a/database_cleanup/view/purge_columns.xml b/database_cleanup/view/purge_columns.xml
index 40ed4a4f6..96aa1212e 100644
--- a/database_cleanup/view/purge_columns.xml
+++ b/database_cleanup/view/purge_columns.xml
@@ -25,12 +25,24 @@
-
+
Purge columns
- ir.actions.act_window
- cleanup.purge.wizard.column
- form
- form
+ ir.actions.server
+ code
+
+
+wizard_id = self.create(cr, uid, {}, context=context)
+action = {
+ 'type': 'ir.actions.act_window',
+ 'views': [(False, 'form')],
+ 'res_model': 'cleanup.purge.wizard.column',
+ 'res_id': wizard_id,
+ 'flags': {
+ 'action_buttons': False,
+ 'sidebar': False,
+ },
+}
+
diff --git a/database_cleanup/view/purge_data.xml b/database_cleanup/view/purge_data.xml
index e749f4569..890d0d450 100644
--- a/database_cleanup/view/purge_data.xml
+++ b/database_cleanup/view/purge_data.xml
@@ -25,12 +25,24 @@
-
+
Purge data entries that refer to missing resources
- ir.actions.act_window
- cleanup.purge.wizard.data
- form
- form
+ ir.actions.server
+ code
+
+
+wizard_id = self.create(cr, uid, {}, context=context)
+action = {
+ 'type': 'ir.actions.act_window',
+ 'views': [(False, 'form')],
+ 'res_model': 'cleanup.purge.wizard.data',
+ 'res_id': wizard_id,
+ 'flags': {
+ 'action_buttons': False,
+ 'sidebar': False,
+ },
+}
+
diff --git a/database_cleanup/view/purge_models.xml b/database_cleanup/view/purge_models.xml
index 0ae1d20e8..2dc25c74c 100644
--- a/database_cleanup/view/purge_models.xml
+++ b/database_cleanup/view/purge_models.xml
@@ -24,12 +24,24 @@
-
+
Purge models
- ir.actions.act_window
- cleanup.purge.wizard.model
- form
- form
+ ir.actions.server
+ code
+
+
+wizard_id = self.create(cr, uid, {}, context=context)
+action = {
+ 'type': 'ir.actions.act_window',
+ 'views': [(False, 'form')],
+ 'res_model': 'cleanup.purge.wizard.model',
+ 'res_id': wizard_id,
+ 'flags': {
+ 'action_buttons': False,
+ 'sidebar': False,
+ },
+}
+
diff --git a/database_cleanup/view/purge_modules.xml b/database_cleanup/view/purge_modules.xml
index 7c0151f54..65dd5473a 100644
--- a/database_cleanup/view/purge_modules.xml
+++ b/database_cleanup/view/purge_modules.xml
@@ -24,12 +24,24 @@
-
+
Purge modules
- ir.actions.act_window
- cleanup.purge.wizard.module
- form
- form
+ ir.actions.server
+ code
+
+
+wizard_id = self.create(cr, uid, {}, context=context)
+action = {
+ 'type': 'ir.actions.act_window',
+ 'views': [(False, 'form')],
+ 'res_model': 'cleanup.purge.wizard.module',
+ 'res_id': wizard_id,
+ 'flags': {
+ 'action_buttons': False,
+ 'sidebar': False,
+ },
+}
+
diff --git a/database_cleanup/view/purge_tables.xml b/database_cleanup/view/purge_tables.xml
index dc9ddd8f5..b963a2f02 100644
--- a/database_cleanup/view/purge_tables.xml
+++ b/database_cleanup/view/purge_tables.xml
@@ -24,12 +24,24 @@
-
+
Purge tables
- ir.actions.act_window
- cleanup.purge.wizard.table
- form
- form
+ ir.actions.server
+ code
+
+
+wizard_id = self.create(cr, uid, {}, context=context)
+action = {
+ 'type': 'ir.actions.act_window',
+ 'views': [(False, 'form')],
+ 'res_model': 'cleanup.purge.wizard.table',
+ 'res_id': wizard_id,
+ 'flags': {
+ 'action_buttons': False,
+ 'sidebar': False,
+ },
+}
+