Skip to content

Commit c16497c

Browse files
hbrunnVan
authored andcommitted
[FIX] don't crash if an xmlid refers to a nonexisting field (OCA#559)
1 parent 4d2735b commit c16497c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

database_cleanup/models/purge_modules.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def _module_data_uninstall(self, modules_to_remove):
1919
if this.model == 'ir.model.fields':
2020
field = self.env[this.model].with_context(
2121
**{MODULE_UNINSTALL_FLAG: True}).browse(this.res_id)
22-
if field.model not in self.env:
22+
if not field.exists() or field.model not in self.env:
2323
this.unlink()
2424
continue
2525
if this.model not in self.env:

0 commit comments

Comments
 (0)