summaryrefslogtreecommitdiff
path: root/odoo/addons/base/wizard/base_import_language.py
diff options
context:
space:
mode:
authorMartin Trigaux <mat@odoo.com>2020-05-11 12:46:42 +0000
committerMartin Trigaux <mat@odoo.com>2020-05-19 08:01:17 +0000
commitc142f1628d4e7b13a7de5a8cf0790d7425badc05 (patch)
tree178cf889fe8b835267f05597153d934e4b65845e /odoo/addons/base/wizard/base_import_language.py
parentfa00ff97be5429f2d3fb43a28a8d4eb38e25f4c5 (diff)
[FIX] tools: reimport translations in csv
Before this commit trying to reimport csv of a translation failed. The reason was that before 632fa044c3c20cd the parsing was common between po and csv while now it's split in two different parsers. The res_id column of the CSV is the external id of the record and is handled by IrTranslationImport. Use DictReader instead of csv_reader to easily add new keys and still be flexible on the given csv files. Match the POReader format with a imd_model and imd_name column. As for the PoFileReader, the code translations are unique and must be discarded in case of duplicate. Correct the error message if the imported file is not correct (was missing an argument) Fixes odoo/odoo#50975 closes odoo/odoo#51468 X-original-commit: 3cedadb5ba606e156f52e70ed08b25ac2df8d58b Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Diffstat (limited to 'odoo/addons/base/wizard/base_import_language.py')
-rw-r--r--odoo/addons/base/wizard/base_import_language.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/odoo/addons/base/wizard/base_import_language.py b/odoo/addons/base/wizard/base_import_language.py
index be2da88318b..ae31b34447b 100644
--- a/odoo/addons/base/wizard/base_import_language.py
+++ b/odoo/addons/base/wizard/base_import_language.py
@@ -53,7 +53,7 @@ class BaseLanguageImport(models.TransientModel):
raise UserError(_('File %r not imported due to a malformed file.\n\n'
'This issue can be caused by duplicates entries who are referring to the same field. '
'Please check the content of the file you are trying to import.\n\n'
- 'Technical Details:\n%s') % tools.ustr(e))
+ 'Technical Details:\n%s') % (self.filename, tools.ustr(e)))
except Exception as e:
_logger.exception('File unsuccessfully imported, due to format mismatch.')
raise UserError(