2015-07-28 11:58:54 +00:00
|
|
|
import time
|
|
|
|
|
2017-11-23 04:25:06 +00:00
|
|
|
from netforce.model import Model, fields, get_model
|
2015-07-28 11:58:54 +00:00
|
|
|
|
|
|
|
class PatientMove(Model):
|
2017-11-23 04:25:06 +00:00
|
|
|
_name='clinic.patient.move'
|
|
|
|
|
2015-07-28 11:58:54 +00:00
|
|
|
_fields={
|
2017-11-23 04:25:06 +00:00
|
|
|
'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),
|
2015-07-28 11:58:54 +00:00
|
|
|
}
|
2017-11-23 04:25:06 +00:00
|
|
|
|
|
|
|
|
2015-07-28 11:58:54 +00:00
|
|
|
_defaults={
|
|
|
|
'date': lambda *a: time.strftime("%Y-%m-%d %H:%M:%S"),
|
|
|
|
}
|
|
|
|
|
2017-11-23 04:25:06 +00:00
|
|
|
PatientMove.register()
|