title: function returning datetime in openerp
body: <p>I'm trying to create a function returning datetime, but it doesn't work It return error code 2: </p>
  
  <pre><code>def _date_(self, cr, uid, ids, fields, arg, context):
      x={}
      for record in self.browse(cr, uid, ids):
          if record.date :
              a = datetime.strptime(record.date, "%Y-%m-%d %H:%M:%S")
              b = a.strftime("%Y-%m-%d %H:%M:%S")
              x[record.id] = b
          return x
  
  _columns = {
      'date': fields.datetime('Date-Hour of Call', required=True),    
      'date_': fields.function(_date_, string='date copy'),
  </code></pre>
  
  <p>Best Regards,</p>