Browse Source

[FIX] don't crash if an xmlid refers to a nonexisting field (#559)

pull/1408/head
Holger Brunn 8 years ago
committed by Pedro M. Baeza
parent
commit
c2ca39e15c
  1. 2
      database_cleanup/models/purge_modules.py

2
database_cleanup/models/purge_modules.py

@ -19,7 +19,7 @@ class IrModelData(models.Model):
if this.model == 'ir.model.fields': if this.model == 'ir.model.fields':
field = self.env[this.model].with_context( field = self.env[this.model].with_context(
**{MODULE_UNINSTALL_FLAG: True}).browse(this.res_id) **{MODULE_UNINSTALL_FLAG: True}).browse(this.res_id)
if field.model not in self.env:
if not field.exists() or field.model not in self.env:
this.unlink() this.unlink()
continue continue
if this.model not in self.env: if this.model not in self.env:

Loading…
Cancel
Save