more choices for getting a language out of the qweb context
parent
3a28f874c7
commit
a12a7fb01e
|
@ -39,8 +39,12 @@ class QWeb(models.Model):
|
||||||
generated_attributes, qwebcontext):
|
generated_attributes, qwebcontext):
|
||||||
tformat = template_attributes['usertime']
|
tformat = template_attributes['usertime']
|
||||||
if not tformat:
|
if not tformat:
|
||||||
# No format, use default time and date formats from user lang
|
# No format, use default time and date formats from qwebcontext
|
||||||
lang = qwebcontext['user'].lang
|
lang = (
|
||||||
|
qwebcontext['env'].lang or
|
||||||
|
qwebcontext['env'].context['lang'] or
|
||||||
|
qwebcontext['user'].lang
|
||||||
|
)
|
||||||
if lang:
|
if lang:
|
||||||
lang = qwebcontext['env']['res.lang'].search(
|
lang = qwebcontext['env']['res.lang'].search(
|
||||||
[('code', '=', lang)]
|
[('code', '=', lang)]
|
||||||
|
|
Loading…
Reference in New Issue