clinic/netforce_clinic/models/patient_cause.py

19 lines
525 B
Python

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