Skip to content
Snippets Groups Projects
Commit 8428910a authored by Denis Ledoux's avatar Denis Ledoux
Browse files

[FIX] mail: format_date with falsy date

If the date passed is falsy, return
an empty string instead of crashing.

opw-704260
parent 629d80c3
Branches
Tags
No related merge requests found
......@@ -20,6 +20,8 @@ _logger = logging.getLogger(__name__)
def format_date(pool, cr, uid, date, pattern=False, context=None):
if not date:
return ''
date = datetime.datetime.strptime(date[:10], openerp.tools.DEFAULT_SERVER_DATE_FORMAT)
lang_code = context.get('lang') or 'en_US'
if not pattern:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment