[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
This commit is contained in:
Nicolas Lempereur
2017-06-30 14:14:27 +02:00
parent 3ffd8d1602
commit b3e7753d1b
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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()
+1 -1
View File
@@ -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')