[REM] Remove single auth="admin" left
bzr revid: fme@openerp.com-20140129144623-a8fy4xx3hmvcww0j
This commit is contained in:
parent
b91b265cb8
commit
07235017aa
|
@ -725,26 +725,28 @@ class WebClient(http.Controller):
|
|||
return {"modules": translations_per_module,
|
||||
"lang_parameters": None}
|
||||
|
||||
@http.route('/web/webclient/translations', type='json', auth="admin")
|
||||
@http.route('/web/webclient/translations', type='json', auth="none")
|
||||
def translations(self, mods=None, lang=None):
|
||||
request.disable_db = False
|
||||
uid = openerp.SUPERUSER_ID
|
||||
if mods is None:
|
||||
m = request.registry.get('ir.module.module')
|
||||
mods = [x['name'] for x in m.search_read(request.cr, request.uid,
|
||||
mods = [x['name'] for x in m.search_read(request.cr, uid,
|
||||
[('state','=','installed')], ['name'])]
|
||||
if lang is None:
|
||||
lang = request.context["lang"]
|
||||
res_lang = request.registry.get('res.lang')
|
||||
ids = res_lang.search(request.cr, request.uid, [("code", "=", lang)])
|
||||
ids = res_lang.search(request.cr, uid, [("code", "=", lang)])
|
||||
lang_params = None
|
||||
if ids:
|
||||
lang_params = res_lang.read(request.cr, request.uid, ids[0], ["direction", "date_format", "time_format",
|
||||
lang_params = res_lang.read(request.cr, uid, ids[0], ["direction", "date_format", "time_format",
|
||||
"grouping", "decimal_point", "thousands_sep"])
|
||||
|
||||
# Regional languages (ll_CC) must inherit/override their parent lang (ll), but this is
|
||||
# done server-side when the language is loaded, so we only need to load the user's lang.
|
||||
ir_translation = request.registry.get('ir.translation')
|
||||
translations_per_module = {}
|
||||
messages = ir_translation.search_read(request.cr, request.uid, [('module','in',mods),('lang','=',lang),
|
||||
messages = ir_translation.search_read(request.cr, uid, [('module','in',mods),('lang','=',lang),
|
||||
('comments','like','openerp-web'),('value','!=',False),
|
||||
('value','!=','')],
|
||||
['module','src','value','lang'], order='module')
|
||||
|
|
Loading…
Reference in New Issue