clinic/netforce_clinic/models/patient_cause.py

19 lines
525 B
Python
Raw Permalink Normal View History

2014-10-01 16:59:35 +00:00
import time
from netforce.model import Model, fields
2014-11-05 07:22:23 +00:00
class PatientCause(Model):
_name="clinic.patient.cause"
_string="Patient Cause"
2014-10-01 16:59:35 +00:00
_fields={
2015-03-02 04:03:07 +00:00
"patient_id": fields.Many2One("clinic.patient","Patient",required=True,on_delete="cascade",domain=[['state','=','admit']]),
2014-10-01 16:59:35 +00:00
"cause_id": fields.Many2One("clinic.cause.chronic","Cause"),
"date_cause": fields.Date("Date Cause"),
}
_defaults={
'date_cause': lambda *a: time.strftime("%Y-%m-%d"),
}
2014-11-05 07:22:23 +00:00
PatientCause.register()