diff --git a/qweb_usertime/qweb.py b/qweb_usertime/qweb.py index ba7d6a8dff0..1d257675ee7 100644 --- a/qweb_usertime/qweb.py +++ b/qweb_usertime/qweb.py @@ -39,8 +39,12 @@ def render_tag_usertime(self, element, template_attributes, generated_attributes, qwebcontext): tformat = template_attributes['usertime'] if not tformat: - # No format, use default time and date formats from user lang - lang = qwebcontext['user'].lang + # No format, use default time and date formats from qwebcontext + lang = ( + qwebcontext['env'].lang or + qwebcontext['env'].context['lang'] or + qwebcontext['user'].lang + ) if lang: lang = qwebcontext['env']['res.lang'].search( [('code', '=', lang)]