conv_bal
watcha.h@almacom.co.th 2015-06-12 06:42:08 +07:00
parent 1a61b83116
commit a1be6b9bcc
2 changed files with 9 additions and 3 deletions

View File

@ -3,6 +3,7 @@ from netforce.model import Model, fields
class PatientCycle(Model): class PatientCycle(Model):
_name="clinic.patient.cycle" _name="clinic.patient.cycle"
_string="Patient Cycle" _string="Patient Cycle"
_audit_log=True
_fields={ _fields={
"patient_id": fields.Many2One('clinic.patient',"Patient",required=True,on_delete="cascade",search=True,domain=[['state','=','admit']]), "patient_id": fields.Many2One('clinic.patient',"Patient",required=True,on_delete="cascade",search=True,domain=[['state','=','admit']]),

View File

@ -87,13 +87,18 @@ class VisitPopupConfirm(Model):
obj=self.browse(ids)[0] obj=self.browse(ids)[0]
board=obj.visitboard_id board=obj.visitboard_id
count=0 count=0
user_id=get_active_user()
nurse_ids=get_model("clinic.staff").search([['user_id','=',user_id],['type','=','nurse']])
vals={}
if nurse_ids:
vals['nurse_id']=nurse_ids[0]
for line in obj.lines: for line in obj.lines:
vs=line.visit_id vs=line.visit_id
dt=line.doctor_id dt=line.doctor_id
if dt: if dt:
vs.write({ vals['doctor_id']=dt.id
'doctor_id': dt.id, vs.write(vals)
})
vs.confirm() vs.confirm()
count+=1 count+=1
return { return {