diff --git a/account_chart_update_multilang/tests/test_account_chart_update_multilang.py b/account_chart_update_multilang/tests/test_account_chart_update_multilang.py index 49439540093..fe84fa8df21 100644 --- a/account_chart_update_multilang/tests/test_account_chart_update_multilang.py +++ b/account_chart_update_multilang/tests/test_account_chart_update_multilang.py @@ -32,7 +32,7 @@ def test_update_taxes(self): ] ) self.assertEqual( - new_tax.with_context(lang="en_EN").description, "tax description eng" + new_tax.with_context(lang="en_US").description, "tax description eng" ) self.assertEqual(new_tax.with_context(lang="es_ES").name, "tax name es") self.assertEqual( @@ -42,3 +42,15 @@ def test_update_taxes(self): self.assertEqual( new_tax.with_context(lang="fr_FR").description, "tax description fr" ) + + def test_update_taxes_with_english_deactivate(self): + # When English is not active the chart update should work also + self.env["res.partner"].with_context(active_test=False).search([]).write( + {"lang": "es_ES"} + ) + self.env["res.users"].with_context(active_test=False).search([]).write( + {"lang": "es_ES"} + ) + lang_model = self.env["res.lang"] + lang_model.search([("code", "=", "en_US")]).write({"active": False}) + self.test_update_taxes() diff --git a/account_chart_update_multilang/wizards/wizard_chart_update.py b/account_chart_update_multilang/wizards/wizard_chart_update.py index c26ab4942c4..76a4387b7ec 100644 --- a/account_chart_update_multilang/wizards/wizard_chart_update.py +++ b/account_chart_update_multilang/wizards/wizard_chart_update.py @@ -16,7 +16,7 @@ def _other_langs(self): def _get_lang_selection_options(self): """Only can translate in base language by default.""" - en = self.env["res.lang"]._lang_get("en_US") + en = self.env.ref("base.lang_en") return [(en.code, en.name)] def _update_other_langs(self, templates):