ignore template fields that do not exist in real

This commit is contained in:
Luc De Meyer
2020-10-31 17:19:19 +01:00
committed by gaikaz
parent 0803870d0b
commit d3ea9110d2

View File

@@ -662,7 +662,7 @@ class WizardUpdateChartsAccounts(models.TransientModel):
}
to_include = template_field_mapping[template._name].mapped("name")
for key, field in template._fields.items():
if key in ignore or key not in to_include:
if key in ignore or key not in to_include or not hasattr(real, key):
continue
expected = None
# Translate template records to reals for comparison