Skip to content

Commit

Permalink
Merge PR #1976 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by rafaelbn
  • Loading branch information
OCA-git-bot committed Nov 21, 2024
2 parents 3ffc8ab + 5d4690c commit 92bae06
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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()
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 92bae06

Please sign in to comment.