clinic/netforce_clinic/models/patient_move.py

24 lines
915 B
Python
Raw Permalink Normal View History

2015-07-28 11:58:54 +00:00
import time
from netforce.model import Model, fields, get_model
2015-07-28 11:58:54 +00:00
class PatientMove(Model):
_name='clinic.patient.move'
2015-07-28 11:58:54 +00:00
_fields={
2017-11-28 08:48:52 +00:00
"patient_id": fields.Many2One("clinic.patient", "Patient", required=True, on_delete="cascade"),
"type_id": fields.Many2One("clinic.patient.type","Type",search=True,required=True),
"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),
2017-11-24 06:40:34 +00:00
"location_from_id": fields.Many2One("stock.location", "From Location", required=False, search=True),
"location_to_id": fields.Many2One("stock.location", "To Location", required=False, search=True),
2015-07-28 11:58:54 +00:00
}
2015-07-28 11:58:54 +00:00
_defaults={
'date': lambda *a: time.strftime("%Y-%m-%d %H:%M:%S"),
}
PatientMove.register()