Saturday, 15 February 2014

function returning datetime in openerp -



function returning datetime in openerp -

i'm trying create function returning datetime, doesn't work homecoming error code 2:

def _date_(self, cr, uid, ids, fields, arg, context): x={} record in self.browse(cr, uid, ids): if record.date : = datetime.strptime(record.date, "%y-%m-%d %h:%m:%s") b = a.strftime("%y-%m-%d %h:%m:%s") x[record.id] = b homecoming x _columns = { 'date': fields.datetime('date-hour of call', required=true), 'date_': fields.function(_date_, string='date copy'),

best regards,

you have define column date_ this:

'date_': fields.function(_date_, type='datetime', string='date copy'),

thanks

datetime openerp

No comments:

Post a Comment