diff --git a/odoo/addons/test_translation_import/i18n/fr.po b/odoo/addons/test_translation_import/i18n/fr.po index 478682cd0a8..3e3abcfe2ab 100644 --- a/odoo/addons/test_translation_import/i18n/fr.po +++ b/odoo/addons/test_translation_import/i18n/fr.po @@ -35,7 +35,7 @@ msgid "test.translation.import" msgstr "test.translation.import in french" #. module: test_translation_import -#: help:test.translation.import,name:0 +#: model:ir.model.fields,help:test_translation_import.field_test_translation_import__name msgid "Efgh" msgstr "Efgh in french" diff --git a/odoo/addons/test_translation_import/i18n/test_translation_import.pot b/odoo/addons/test_translation_import/i18n/test_translation_import.pot index 7d197cd620c..39333d2b363 100644 --- a/odoo/addons/test_translation_import/i18n/test_translation_import.pot +++ b/odoo/addons/test_translation_import/i18n/test_translation_import.pot @@ -41,7 +41,7 @@ msgid "test.translation.import" msgstr "" #. module: test_translation_import -#: help:test.translation.import,name:0 +#: model:ir.model.fields,help:test_translation_import.field_test_translation_import__name msgid "Efgh" msgstr "" diff --git a/odoo/tools/translate.py b/odoo/tools/translate.py index 575742c8e3f..4533c8a9bc7 100644 --- a/odoo/tools/translate.py +++ b/odoo/tools/translate.py @@ -1101,14 +1101,15 @@ def trans_load_data(cr, fileobj, fileformat, lang, lang_name=None, verbose=True, # discard the target from the POT targets. src = dic['src'] + target_key = (dic['type'], dic['name'], dic['type'] != 'code' and dic['res_id'] or 0) target = pot_targets.get(src) - if not target or (dic['type'], dic['name'], dic['res_id']) not in target.targets: + if not target or target_key not in target.targets: _logger.info("Translation '%s' (%s, %s, %s) not found in reference pot, skipping", src[:60], dic['type'], dic['name'], dic['res_id']) return target.value = dic['value'] - target.targets.discard((dic['type'], dic['name'], dic['type'] != 'code' and dic['res_id'] or 0)) + target.targets.discard(target_key) # This would skip terms that fail to specify a res_id res_id = dic['res_id'] @@ -1143,7 +1144,6 @@ def trans_load_data(cr, fileobj, fileformat, lang, lang_name=None, verbose=True, if target.value: for type, name, res_id in target.targets: pot_rows.append((type, name, res_id, src, target.value, target.comments)) - pot_targets.clear() for row in pot_rows: process_row(row)