Browse Source

Add a function to format dates

pull/80/head
Houzefa Abbasbhay 11 years ago
parent
commit
1a84a03659
  1. 5
      py3o_report.py

5
py3o_report.py

@ -33,6 +33,11 @@ class py3o_report(report_sxw):
context=context)[0] context=context)[0]
return lang_obj.browse(cr, uid, lang, context=context) 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): def create(self, cr, uid, ids, data, context=None):
# Find the report definition to get its settings. # Find the report definition to get its settings.
pool = pooler.get_pool(cr.dbname) pool = pooler.get_pool(cr.dbname)

Loading…
Cancel
Save