diff --git a/muk_branding/__init__.py b/muk_branding/__init__.py index ecb0b88..32c4f5d 100644 --- a/muk_branding/__init__.py +++ b/muk_branding/__init__.py @@ -42,8 +42,13 @@ def _patch_system(): def _install_debrand_system(cr, registry): env = api.Environment(cr, SUPERUSER_ID, {}) for lang in env['res.lang'].search([('active','=',True)]).mapped('code'): - env['base.language.install'].create({'lang': lang}).lang_install() - env['base.update.translations'].create({'lang': lang}).act_update() + env['base.language.install'].create({ + 'lang': lang, + 'overwrite': True + }).lang_install() + env['base.update.translations'].create({ + 'lang': lang + }).act_update() env['ir.translation'].clear_caches if version_info[5] != 'e': env['ir.module.module'].search([('to_buy', '=', True)]).unlink() diff --git a/muk_branding/models/res_config_settings.py b/muk_branding/models/res_config_settings.py index d28ff3c..354bf15 100644 --- a/muk_branding/models/res_config_settings.py +++ b/muk_branding/models/res_config_settings.py @@ -109,6 +109,11 @@ class ResConfigSettings(models.TransientModel): def translations_reload(self): for lang in self.env['res.lang'].sudo().search([('active','=',True)]).mapped('code'): - self.env['base.language.install'].sudo().create({'lang': lang}).lang_install() - self.env['base.update.translations'].sudo().create({'lang': lang}).act_update() + self.env['base.language.install'].sudo().create({ + 'lang': lang, + 'overwrite': True + }).lang_install() + self.env['base.update.translations'].sudo().create({ + 'lang': lang + }).act_update() self.sudo().env['ir.translation'].clear_caches \ No newline at end of file