From 1a84a036596327a4a6f22aa5643df4d70d86acfe Mon Sep 17 00:00:00 2001 From: Houzefa Abbasbhay Date: Tue, 29 Oct 2013 11:03:33 +0100 Subject: [PATCH] Add a function to format dates --- py3o_report.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/py3o_report.py b/py3o_report.py index f84578ad..73391661 100644 --- a/py3o_report.py +++ b/py3o_report.py @@ -32,6 +32,11 @@ class py3o_report(report_sxw): [('code', '=', lang_code)], context=context)[0] return lang_obj.browse(cr, uid, lang, context=context) + + def format_date(self, date, values): + ''' Return a date formatted according to the language extracted from + the "values" argument (which should be the result of get_values). ''' + return date.strftime(values['lang'].date_format) def create(self, cr, uid, ids, data, context=None): # Find the report definition to get its settings.