import time from netforce.model import Model, fields class PatientMove(Model): _name="clinic.patient.move" _fields={ 'patient_id': fields.Many2One('clinic.patient','Patient'), 'date': fields.DateTime("Date"), 'location_id': fields.Many2One("clinic.department","Department"), } _defaults={ 'date': lambda *a: time.strftime("%Y-%m-%d %H:%M:%S"), } PatientMove()