[sickbed] improve load page

conv_bal
watcha.h@almacom.co.th 2015-04-10 09:53:50 +07:00
parent 8de9d3c23f
commit ab3e8f2d96
1 changed files with 2 additions and 1 deletions

View File

@ -14,7 +14,8 @@ class SickBed(Model):
image=None
date=''
set_active_user(1) #FIXME permission denined because of department of patient
for hd_case in sorted(obj.hd_cases, key=lambda a: a.id):
if obj.hd_cases:
hd_case=sorted(obj.hd_cases, key=lambda a: a.id)[-1]
patient=hd_case.patient_id
patient_id=patient.id
image=patient.image