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

pull/2684/head
Holger Brunn 2016-09-26 14:56:13 +02:00 committed by Miika Nissi
parent 5bba296582
commit e3b8fda908
No known key found for this signature in database
GPG Key ID: B20DC9FCFAF92E7F
1 changed files with 1 additions and 1 deletions

View File

@ -19,7 +19,7 @@ class IrModelData(models.Model):
if this.model == 'ir.model.fields':
field = self.env[this.model].with_context(
**{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()
continue
if this.model not in self.env: