gen visit

conv_bal
watcha.h@almacom.co.th 2015-01-15 21:11:35 +07:00
parent 81ab2ff33d
commit db29c0cc2c
2 changed files with 8 additions and 4 deletions

View File

@ -32,7 +32,7 @@ class MakeAPT(Model):
for pc in get_model("clinic.patient.cycle").search_browse([]):
patient=pc.patient_id
dpt=pc.department_id
key='%s-%s'%(patient.id,dpt.id)
key=(patient.id,dpt.id)
if not pts.get(key):
pts[key]={
'mon_cycle_id': None,
@ -62,9 +62,11 @@ class MakeAPT(Model):
lines=[]
for k, vals in pts.items():
pt_id, dpt_id=k.split("-")
vals['patient_id']=pt_id
vals['department_id']=dpt_id
pt_id, dpt_id=k
if pt_id:
vals['patient_id']=pt_id
if dpt_id:
vals['department_id']=dpt_id
lines.append(('create',vals))
for line in obj.lines:

View File

@ -217,6 +217,8 @@ class VisitBoard(Model):
has_duration=False
if date_from != date_to:
has_duration=True
import pprint
pprint.pprint(lines)
data={
'lines': lines,
'date': utils.date2thai(date_from,format='ประจำวัน%(Td)s ที่ %(d)s %(Tm)s %(BY)s'),