Merge PR #1976 into 16.0

Signed-off-by rafaelbn
This commit is contained in:
OCA-git-bot
2024-11-21 10:14:52 +00:00
2 changed files with 14 additions and 2 deletions

View File

@@ -32,7 +32,7 @@ class TestAccountChartUpdate(TestAccountChartUpdateCommon):
]
)
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 @@ class TestAccountChartUpdate(TestAccountChartUpdateCommon):
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()

View File

@@ -16,7 +16,7 @@ class WizardUpdateChartsAccount(models.TransientModel):
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):