Skip to content
Snippets Groups Projects
Commit f5b69559 authored by Renilkumar Kajavadra's avatar Renilkumar Kajavadra
Browse files

[FIX] base: change logger type to 'warning' on format mismatch


If applied, this commit will handle the KeyError: res_id when the user tries to
import the translation of .csv file in settings -> translations, and if .csv
file doesn't have the res_id column.

I handled the traceback by changing the logger level to warning.

sentry - 4049419481

closes odoo/odoo#120775

X-original-commit: dd0ec40c
Signed-off-by: default avatarRenilkumar Kajavadra (reka) <reka@odoo.com>
Signed-off-by: default avatarRémy Voet <ryv@odoo.com>
parent c9f2d497
Branches
Tags
No related merge requests found
......@@ -41,7 +41,7 @@ class BaseLanguageImport(models.TransientModel):
fileformat = splitext(base_lang_import.filename)[-1][1:].lower()
translation_importer.load(buf, fileformat, base_lang_import.code)
except Exception as e:
_logger.exception('File unsuccessfully imported, due to format mismatch.')
_logger.warning('File unsuccessfully imported, due to format mismatch.')
raise UserError(
_('File %r not imported due to format mismatch or a malformed file.'
' (Valid formats are .csv, .po, .pot)\n\nTechnical Details:\n%s') % \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment