import time from netforce.model import Model, fields class PatientCauseLine(Model): _name="clinic.patient.cause.line" _string="Patient Cause Line" _fields={ "patient_id": fields.Many2One("clinic.patient","Patient",required=True), "cause_id": fields.Many2One("clinic.cause.chronic","Cause"), "date_cause": fields.Date("Date Cause"), } _defaults={ 'date_cause': lambda *a: time.strftime("%Y-%m-%d"), } PatientCauseLine.register()