diff --git a/odoo/addons/base/wizard/base_update_translations.py b/odoo/addons/base/wizard/base_update_translations.py index 0ac9b301d7b..40a99f4f133 100644 --- a/odoo/addons/base/wizard/base_update_translations.py +++ b/odoo/addons/base/wizard/base_update_translations.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. +import tarfile import tempfile from odoo import api, fields, models, tools, _ @@ -27,6 +28,11 @@ class BaseUpdateTranslations(models.TransientModel): def act_update(self): with tempfile.NamedTemporaryFile() as buf: - tools.trans_export(self.lang, ['all'], buf, 'po', self._cr) - tools.trans_load_data(self._cr, buf, 'po', self.lang, create_empty_translation=True) + tools.trans_export(self.lang, ['all'], buf, 'tgz', self._cr) + buf.seek(0) + tar = tarfile.open(fileobj=buf) + for file_info in tar: + module_file = tar.extractfile(file_info) + tools.trans_load_data(self._cr, module_file, 'po', self.lang, create_empty_translation=True) + tar.close() return {'type': 'ir.actions.act_window_close'}