Skip to content

Commit

Permalink
[FIX] don't crash if an xmlid refers to a nonexisting field (OCA#559)
Browse files Browse the repository at this point in the history
  • Loading branch information
hbrunn authored and mart-e committed Oct 26, 2018
1 parent 5ce988a commit 6aef55a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion database_cleanup/models/purge_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def _module_data_uninstall(self, modules_to_remove):
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:
Expand Down

0 comments on commit 6aef55a

Please sign in to comment.