Browse Source

[FIX] Don't remove uid field from wkf_instance, which is written in

raw SQL query (but never read afterwards). Workaround for
    lp:1277899
pull/95/head
Stefan Rijnhart 11 years ago
parent
commit
46a72e1449
  1. 8
      database_cleanup/model/purge_columns.py

8
database_cleanup/model/purge_columns.py

@ -72,6 +72,12 @@ class CleanupPurgeWizardColumn(orm.TransientModel):
_inherit = 'cleanup.purge.wizard'
_name = 'cleanup.purge.wizard.column'
# List of known columns in use without corresponding fields
# Format: {table: [fields]}
blacklist = {
'wkf_instance': ['uid'], # lp:1277899
}
def default_get(self, cr, uid, fields, context=None):
res = super(CleanupPurgeWizardColumn, self).default_get(
cr, uid, fields, context=context)
@ -90,6 +96,8 @@ class CleanupPurgeWizardColumn(orm.TransientModel):
if not (isinstance(model_pool._columns[c], fields.function)
and not model_pool._columns[c].store)]
columns += orm.MAGIC_COLUMNS
columns += self.blacklist.get(model_pool._table, [])
cr.execute("SELECT a.attname"
" FROM pg_class c, pg_attribute a"
" WHERE c.relname=%s"

Loading…
Cancel
Save