19 lines
512 B
Python
19 lines
512 B
Python
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,on_delete="cascade"),
|
|
"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()
|