Browse Source

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

pull/1009/head
Holger Brunn 8 years ago
parent
commit
24d3fd152a
No known key found for this signature in database GPG Key ID: 1C9760FECA3AE18
  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