Files
odoo_source/addons/web_editor/models/ir_http.py
T
Nicolas Lempereur b3e7753d1b [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
2017-06-30 14:14:27 +02:00

17 lines
665 B
Python

# -*- coding: utf-8 -*-
from openerp.osv import orm
from openerp.http import request
class ir_http(orm.AbstractModel):
_inherit = 'ir.http'
def _dispatch(self):
if 'editable' in request.httprequest.args and 'editable' not in request.context:
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('edit_translations') and 'translatable' not in request.context:
request.context['translatable'] = True
return super(ir_http, self)._dispatch()