import time from netforce.model import Model, fields, get_model class PatientMove(Model): _name='clinic.patient.move' _fields={ 'patient_id': fields.Many2One("clinic.patient", "Patient", required=True, on_delete="cascade"), "date": fields.DateTime("Date"), "patient_name": fields.Char("Patient Name"), "patient_type": fields.Char("Patient Type"), #ปกส. .... "type": fields.Selection([['in','In'],['out','Out']], 'Type', required=True), } _defaults={ 'date': lambda *a: time.strftime("%Y-%m-%d %H:%M:%S"), } PatientMove.register()