From b3e7753d1b63808d17eea04deab35aaf817ec31f Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Fri, 30 Jun 2017 12:59:50 +0200 Subject: [PATCH] [FIX] web{site,_editor}: allow edit en_US field If the website default language is not en_US, qweb fields are not translatable in en_US (and thus can't be translated) because: - the code expected en_US to be the default language. - there was a error in website _dispatch opw-746776 closes #17939 --- addons/web_editor/models/ir_http.py | 2 +- addons/website/models/ir_http.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web_editor/models/ir_http.py b/addons/web_editor/models/ir_http.py index c72fee55e83..874ccc6eddb 100644 --- a/addons/web_editor/models/ir_http.py +++ b/addons/web_editor/models/ir_http.py @@ -11,6 +11,6 @@ class ir_http(orm.AbstractModel): request.context['editable'] = True if 'edit_translations' in request.httprequest.args and 'edit_translations' not in request.context: request.context['edit_translations'] = True - if request.context.get('lang') != "en_US" and 'translatable' not in request.context: + if request.context.get('edit_translations') and 'translatable' not in request.context: request.context['translatable'] = True return super(ir_http, self)._dispatch() diff --git a/addons/website/models/ir_http.py b/addons/website/models/ir_http.py index 136fab1fe20..b8af335a17e 100644 --- a/addons/website/models/ir_http.py +++ b/addons/website/models/ir_http.py @@ -160,7 +160,7 @@ class ir_http(orm.AbstractModel): request.uid = None path.pop(1) return self.reroute('/'.join(path) or '/') - if path[1] == request.website.default_lang_code: + if request.lang == request.website.default_lang_code: request.context['edit_translations'] = False if not request.context.get('tz'): request.context['tz'] = request.session.get('geoip', {}).get('time_zone')