[16.0][FIX] account_chart_update: Translatable fields without translations may raise errors as its fetched by the wizard but has no translated value

@moduon MT-8280
This commit is contained in:
Eduardo López Peñalver
2024-12-30 08:46:59 +01:00
parent ed2f94a41a
commit c3b4036c18
2 changed files with 22 additions and 2 deletions

View File

@@ -31,8 +31,11 @@ class WizardUpdateChartsAccount(models.TransientModel):
for key in self._diff_translate_fields(template, rec):
for lang in self._other_langs():
field = rec._fields[key]
old_value = field._get_stored_translations(rec).get(
rec.env.lang, "en_US"
stored_translation_rec = field._get_stored_translations(rec)
if not stored_translation_rec:
continue
old_value = (
stored_translation_rec.get(rec.env.lang or "en_US") or ""
)
if old_value.startswith("<p>") and old_value.endswith("</p>"):
old_value = old_value[3:-4]