improve confirm visit

conv_bal
watcha.h@almacom.co.th 2015-05-06 15:09:27 +07:00
parent c63f63db76
commit 605fdd2b81
3 changed files with 13 additions and 2 deletions

View File

@ -4,6 +4,7 @@
<list noadd="1">
<field name="cycle_id"/>
<field name="patient_id"/>
<field name="doctor_id"/>
<field name="department_id"/>
</list>
</field>

View File

@ -65,12 +65,16 @@ class VisitPopupConfirm(Model):
cycle=visit.cycle_id
patient=visit.patient_id
department=visit.department_id
lines.append({
doctor=visit.doctor_id
vals={
'patient_id': patient.id,
'cycle_id': cycle.id,
'department_id': department.id,
'visit_id': visit.id,
})
}
if doctor:
vals['doctor_id']=doctor.id
lines.append(vals)
return lines
_defaults={
@ -85,6 +89,11 @@ class VisitPopupConfirm(Model):
count=0
for line in obj.lines:
vs=line.visit_id
dt=line.doctor_id
if dt:
vs.write({
'doctor_id': dt.id,
})
vs.confirm()
count+=1
return {

View File

@ -10,6 +10,7 @@ class VisitPopupConfirmLine(Model):
'department_id': fields.Many2One("clinic.department","Department"),
'cycle_id': fields.Many2One("clinic.cycle","Cycle"),
'visit_id': fields.Many2One("clinic.visit","Visit"),
'doctor_id': fields.Many2One("clinic.staff","Doctor",domain=[['type','=','doctor']]),
}
_defaults={