Guess date formating in format_lang by value type

review956003
This commit is contained in:
Cédric Krier
2013-07-04 19:34:02 +02:00
parent 85fbe14011
commit 256d2f9269
+5 -1
View File
@@ -312,7 +312,11 @@ class Report(URLMixin, PoolBase):
Lang = pool.get('ir.lang')
Config = pool.get('ir.configuration')
if date:
if date or isinstance(value, datetime.date):
if date:
warnings.warn('date parameter of format_lang is deprecated, '
'use a datetime.date as value instead', DeprecationWarning,
stacklevel=2)
if lang:
locale_format = lang.date
code = lang.code