[FIX] email_template: format tz, do no display tz if none set

When displaying the datetime according to the lang in the context

Otherwise, it displays '(False)' at the end of the datetime
This commit is contained in:
Denis Ledoux 2015-01-29 14:47:19 +01:00
parent f650522bbf
commit 4b756c599d
1 changed files with 1 additions and 1 deletions

View File

@ -60,7 +60,7 @@ def format_tz(pool, cr, uid, dt, tz=False, format=False, context=None):
fdate = ts.strftime(format_date)
ftime = ts.strftime(format_time)
return "%s %s (%s)" % (fdate, ftime, tz)
return "%s %s%s" % (fdate, ftime, (' (%s)' % tz) if tz else '')
try:
# We use a jinja2 sandboxed environment to render mako templates.