improve report

conv_bal
watcha.h@almacom.co.th 2015-06-12 14:38:26 +07:00
parent e5467144d1
commit 2c3f578cc6
2 changed files with 8 additions and 3 deletions

View File

@ -177,6 +177,8 @@ class Patient(Model):
'walkin': fields.Selection([['yes','Yes'],['no','No']],"Walkin"), 'walkin': fields.Selection([['yes','Yes'],['no','No']],"Walkin"),
#'department_names': fields.Text("Departments",function="_get_department_names"), #'department_names': fields.Text("Departments",function="_get_department_names"),
'location': fields.Char("Location"), #to filter 'location': fields.Char("Location"), #to filter
'cw_time': fields.DateTime("Cycle Updated"),
'cw_uid': fields.Many2One("base.user"," Cycle Edit"),
} }
def _get_number(self,context={}): def _get_number(self,context={}):
@ -354,8 +356,9 @@ class Patient(Model):
['manual','=',False], ['manual','=',False],
] ]
visit_ids=get_model("clinic.visit").search(vdom) visit_ids=get_model("clinic.visit").search(vdom)
print('removing visit .. ', len(visit_ids))
get_model("clinic.visit").delete(visit_ids) get_model("clinic.visit").delete(visit_ids)
vals['cw_time']=time.strftime("%Y-%m-%d %H:%M:%S")
vals['cw_uid']=get_active_user()
if 'type_id' in vals.keys(): if 'type_id' in vals.keys():
#update patient in hd case which state is condition below #update patient in hd case which state is condition below

View File

@ -99,9 +99,11 @@ class ReportCycleSetting(Model):
continue continue
key=(patient.id,dpt.id) key=(patient.id,dpt.id)
if not pts.get(key): if not pts.get(key):
login=patient.w_uid.login login=''
if patient.cw_uid:
login=patient.cw_uid.login
pts[key]={ pts[key]={
'w_time': patient.w_time, 'w_time': patient.cw_time,
'w_uid': login, 'w_uid': login,
'patient_name': patient.name, 'patient_name': patient.name,
'department_name': dpt.name, 'department_name': dpt.name,