From b0680dac6938c8d6ae3ea8d60833e3b4c8307734 Mon Sep 17 00:00:00 2001 From: "watcha.h" Date: Sun, 2 Nov 2014 09:13:15 +0700 Subject: [PATCH] report dialy --- .../actions/clinic_cycle_dialy.xml | 11 +++++++ .../actions/clinic_visit_dialy.xml | 11 +++++++ .../layouts/clinic_cycle_item_form.xml | 31 +++++++++++-------- netforce_clinic/layouts/clinic_menu.xml | 5 ++- .../layouts/clinic_personal_categ_form.xml | 3 +- .../layouts/clinic_personal_categ_list.xml | 1 + .../layouts/clinic_personal_form.xml | 4 +-- netforce_clinic/models/personal_categ.py | 1 + netforce_clinic/models/visit.py | 16 +++++----- netforce_clinic/todo.txt | 5 +++ 10 files changed, 62 insertions(+), 26 deletions(-) create mode 100644 netforce_clinic/actions/clinic_cycle_dialy.xml create mode 100644 netforce_clinic/actions/clinic_visit_dialy.xml diff --git a/netforce_clinic/actions/clinic_cycle_dialy.xml b/netforce_clinic/actions/clinic_cycle_dialy.xml new file mode 100644 index 0000000..5df7a10 --- /dev/null +++ b/netforce_clinic/actions/clinic_cycle_dialy.xml @@ -0,0 +1,11 @@ + + Cycle Dialy + report_view + clinic.cycle.item + + date + cycle_id + + + clinic_menu + diff --git a/netforce_clinic/actions/clinic_visit_dialy.xml b/netforce_clinic/actions/clinic_visit_dialy.xml new file mode 100644 index 0000000..6f333bb --- /dev/null +++ b/netforce_clinic/actions/clinic_visit_dialy.xml @@ -0,0 +1,11 @@ + + Visit Dialy + report_view + clinic.visit + + visit_date + cycle_id + + + clinic_menu + diff --git a/netforce_clinic/layouts/clinic_cycle_item_form.xml b/netforce_clinic/layouts/clinic_cycle_item_form.xml index 6416391..65d0294 100644 --- a/netforce_clinic/layouts/clinic_cycle_item_form.xml +++ b/netforce_clinic/layouts/clinic_cycle_item_form.xml @@ -7,19 +7,24 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/netforce_clinic/layouts/clinic_menu.xml b/netforce_clinic/layouts/clinic_menu.xml index 435e082..543b368 100644 --- a/netforce_clinic/layouts/clinic_menu.xml +++ b/netforce_clinic/layouts/clinic_menu.xml @@ -30,12 +30,11 @@ -
+ + -
-
"
diff --git a/netforce_clinic/layouts/clinic_personal_categ_form.xml b/netforce_clinic/layouts/clinic_personal_categ_form.xml index 130ec52..396f1c9 100644 --- a/netforce_clinic/layouts/clinic_personal_categ_form.xml +++ b/netforce_clinic/layouts/clinic_personal_categ_form.xml @@ -1,4 +1,5 @@
- + + diff --git a/netforce_clinic/layouts/clinic_personal_categ_list.xml b/netforce_clinic/layouts/clinic_personal_categ_list.xml index 1c05326..3b8b4fd 100644 --- a/netforce_clinic/layouts/clinic_personal_categ_list.xml +++ b/netforce_clinic/layouts/clinic_personal_categ_list.xml @@ -1,4 +1,5 @@ + diff --git a/netforce_clinic/layouts/clinic_personal_form.xml b/netforce_clinic/layouts/clinic_personal_form.xml index cc4898d..6c788fe 100644 --- a/netforce_clinic/layouts/clinic_personal_form.xml +++ b/netforce_clinic/layouts/clinic_personal_form.xml @@ -15,8 +15,8 @@ - - + + diff --git a/netforce_clinic/models/personal_categ.py b/netforce_clinic/models/personal_categ.py index 2f38cf4..4928687 100644 --- a/netforce_clinic/models/personal_categ.py +++ b/netforce_clinic/models/personal_categ.py @@ -6,6 +6,7 @@ class PersonalCategory(Model): _fields={ "name": fields.Char("Name",required=True,search=True), + "type": fields.Selection([("doctor","Doctor"),("nurse","Nurse"),('other','Other')],"Type"), 'parent_id': fields.Many2One("clinic.personal.categ","Parent"), } diff --git a/netforce_clinic/models/visit.py b/netforce_clinic/models/visit.py index e9425d1..ff59c7e 100644 --- a/netforce_clinic/models/visit.py +++ b/netforce_clinic/models/visit.py @@ -12,12 +12,6 @@ class Visit(Model): _audit_log=True _name_field="number" _multi_company=True - - def _get_visit_date(self,ids,context={}): - res={} - for obj in self.browse(ids): - res[obj.id]=obj.time_start[0:10] - return res def _get_print_date(self,ids,context={}): res={} @@ -39,7 +33,7 @@ class Visit(Model): "cycle_id": fields.Many2One("clinic.cycle","Cycle"), "state": fields.Selection([["draft","Draft"],["confirmed","Confirmed"],["cancelled","Cancelled"]],"Status",required=True), "comments": fields.One2Many("message","related_id","Comments"), - 'visit_date': fields.Date('Visit Date',function="_get_visit_date"), + 'visit_date': fields.Date('Visit Date'), 'print_date': fields.Date('Print Date',function="_get_print_date"), 'cycle_item_id': fields.Many2One("clinic.cycle.item","Cycle Item"), # on_delete="cascade" -> rm visit from cycle item 'sequence': fields.Char("Sequence"), @@ -304,6 +298,7 @@ class Visit(Model): item_id=item_ids[0] vals['cycle_item_id']=item_id vals['sequence']='%s-%s'%(vals['time_start'][0:10],cycle.sequence) #date-sequence + vals['visit_date']=vals['time_start'][0:10] obj_id=super().create(vals,**kw) return obj_id @@ -320,5 +315,12 @@ class Visit(Model): }, 'flash': 'Visit\'s %s has been cancelled'%obj.patient_id.name } + + 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] + super().write(ids,vals,**kw) Visit.register() diff --git a/netforce_clinic/todo.txt b/netforce_clinic/todo.txt index a97a475..2fc686e 100644 --- a/netforce_clinic/todo.txt +++ b/netforce_clinic/todo.txt @@ -1,3 +1,8 @@ +missing: + - search calendar + - color calendar + - can not move calendar's schedule + dashboard : hd summary report -> click and go direct cycle item: