mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
Add a function to format dates
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user