mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
[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:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user