From 1cd49dab69107e8c91bdde3e0534883cf39165e7 Mon Sep 17 00:00:00 2001 From: "watcha.h" Date: Sun, 2 Nov 2014 10:03:28 +0700 Subject: [PATCH] visit report dialy --- netforce_clinic/actions/clinic_visit_dialy.xml | 5 ++--- netforce_clinic/layouts/clinic_visit_dialy.xml | 9 +++++++++ netforce_clinic/layouts/clinic_visit_form.xml | 1 + netforce_clinic/models/gen_visit.py | 3 ++- netforce_clinic/models/visit.py | 9 +++++---- netforce_clinic/todo.txt | 2 +- 6 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 netforce_clinic/layouts/clinic_visit_dialy.xml diff --git a/netforce_clinic/actions/clinic_visit_dialy.xml b/netforce_clinic/actions/clinic_visit_dialy.xml index 6f333bb..ed812d0 100644 --- a/netforce_clinic/actions/clinic_visit_dialy.xml +++ b/netforce_clinic/actions/clinic_visit_dialy.xml @@ -4,8 +4,7 @@ clinic.visit visit_date - cycle_id - - + visit_date,cycle_id + clinic_visit_dialy clinic_menu diff --git a/netforce_clinic/layouts/clinic_visit_dialy.xml b/netforce_clinic/layouts/clinic_visit_dialy.xml new file mode 100644 index 0000000..a0fc11c --- /dev/null +++ b/netforce_clinic/layouts/clinic_visit_dialy.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/netforce_clinic/layouts/clinic_visit_form.xml b/netforce_clinic/layouts/clinic_visit_form.xml index abbba06..5e27b9a 100644 --- a/netforce_clinic/layouts/clinic_visit_form.xml +++ b/netforce_clinic/layouts/clinic_visit_form.xml @@ -22,6 +22,7 @@ + diff --git a/netforce_clinic/models/gen_visit.py b/netforce_clinic/models/gen_visit.py index b90590b..5df763a 100644 --- a/netforce_clinic/models/gen_visit.py +++ b/netforce_clinic/models/gen_visit.py @@ -130,6 +130,7 @@ class GenVisit(Model): schedules={} for patient_id in patients: + patient=get_model("clinic.patient").browse(patient_id) ntoday=1 day_total=(date_to-date_from).days+ntoday for weekday in days: @@ -149,7 +150,7 @@ class GenVisit(Model): ttime_stop="%s %s" % (tmp.strftime(FMT_DATE),date_to.strftime(FMT_DATETIME)[11:]) vals={ 'patient_id': patient_id, - 'doctor_id': obj.doctor_id.id, + 'doctor_id': obj.doctor_id.id or patient.doctor_id.id, 'department_id': obj.department_id.id, 'cycle_id': obj.cycle_id.id, 'time_start': ttime_start, diff --git a/netforce_clinic/models/visit.py b/netforce_clinic/models/visit.py index ff59c7e..383e771 100644 --- a/netforce_clinic/models/visit.py +++ b/netforce_clinic/models/visit.py @@ -84,6 +84,7 @@ class Visit(Model): "company_id": lambda *a: get_active_company(), 'nurse_id': _get_nurse, } + _order="sequence" def confirm(self,ids,context={}): @@ -317,10 +318,10 @@ class Visit(Model): } def write(self,ids,vals,**kw): - cycle_id=vals['cycle_id'] - cycle=get_model("clinic.cycle").browse(cycle_id) - vals['sequence']='%s-%s'%(vals['time_start'][0:10],cycle.sequence) #date-sequence - vals['visit_date']=vals['time_start'][0:10] + obj=self.browse(ids)[0] + cycle=obj.cycle_id + vals['sequence']='%s-%s'%(obj.time_start[0:10],cycle.sequence) #date-sequence + vals['visit_date']=obj.time_start[0:10] super().write(ids,vals,**kw) Visit.register() diff --git a/netforce_clinic/todo.txt b/netforce_clinic/todo.txt index 2fc686e..cad01b7 100644 --- a/netforce_clinic/todo.txt +++ b/netforce_clinic/todo.txt @@ -2,7 +2,7 @@ missing: - search calendar - color calendar - can not move calendar's schedule - + - order's visit report dialy dashboard : hd summary report -> click and go direct cycle item: