From 7592f4aacff6a48e149b8fcdebb2ffbe4f92b0d2 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Mon, 26 Sep 2016 14:56:13 +0200 Subject: [PATCH] [FIX] don't crash if an xmlid refers to a nonexisting field (#559) --- database_cleanup/models/purge_modules.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database_cleanup/models/purge_modules.py b/database_cleanup/models/purge_modules.py index 89f4f0b43..6b20b9a6f 100644 --- a/database_cleanup/models/purge_modules.py +++ b/database_cleanup/models/purge_modules.py @@ -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: