mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
[16.0][FIX] account_chart_update_multilang: error when English language is not active.
@moduon MT-8060
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user