diff --git a/addons/http_routing/models/ir_http.py b/addons/http_routing/models/ir_http.py index 759c2af20af..657895dc823 100644 --- a/addons/http_routing/models/ir_http.py +++ b/addons/http_routing/models/ir_http.py @@ -167,6 +167,9 @@ def url_lang(path_or_uri, lang_code=None): # Insert the context language or the provided language elif lang_url_code != default_lg.url_code or force_lang: ps.insert(1, lang_url_code) + # Remove the last empty string to avoid trailing / after joining + if ps[-1] == '': + ps.pop(-1) location = u'/'.join(ps) + sep + qs return location diff --git a/addons/website/tests/test_qweb.py b/addons/website/tests/test_qweb.py index e58246174d0..ae2848c5c67 100644 --- a/addons/website/tests/test_qweb.py +++ b/addons/website/tests/test_qweb.py @@ -77,7 +77,7 @@ class TestQwebProcessAtt(TransactionCase): def test_process_att_with_request_lang(self): with MockRequest(self.env, website=self.website, context={'lang': 'fr_FR'}): - self._test_att('/', {'href': '/fr/'}) + self._test_att('/', {'href': '/fr'}) self._test_att('/en/', {'href': '/'}) self._test_att('/fr/', {'href': '/fr/'}) self._test_att('/fr', {'href': '/fr'})