From faaeb2146cbccde7511afaac5746f3e3299e1729 Mon Sep 17 00:00:00 2001 From: "watcha.h@almacom.co.th" Date: Mon, 19 Jan 2015 10:08:14 +0700 Subject: [PATCH] search department on visit board --- netforce_clinic/layouts/clinic_visit_board.xml | 1 + netforce_clinic/models/visit_board.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/netforce_clinic/layouts/clinic_visit_board.xml b/netforce_clinic/layouts/clinic_visit_board.xml index 5b646ee..aed18d6 100644 --- a/netforce_clinic/layouts/clinic_visit_board.xml +++ b/netforce_clinic/layouts/clinic_visit_board.xml @@ -5,6 +5,7 @@ + diff --git a/netforce_clinic/models/visit_board.py b/netforce_clinic/models/visit_board.py index 96ce4c7..83b6122 100644 --- a/netforce_clinic/models/visit_board.py +++ b/netforce_clinic/models/visit_board.py @@ -31,6 +31,7 @@ class VisitBoard(Model): "date_to": fields.Date("To", required=True), 'patient_id': fields.Many2One("clinic.patient","Patient"), 'cycle_id': fields.Many2One("clinic.cycle","Cycle"), + 'department_id': fields.Many2One("clinic.department","Department"), 'doctor_id': fields.Many2One("clinic.staff","Doctor",domain=[["type","=","doctor"]]), } @@ -49,6 +50,7 @@ class VisitBoard(Model): patient_id=None cycle_id=None doctor_id=None + department_id=None if ids: obj=self.browse(ids)[0] date_from=obj.date_from @@ -56,6 +58,7 @@ class VisitBoard(Model): patient_id=obj.patient_id.id cycle_id=obj.cycle_id.id doctor_id=obj.doctor_id.id + department_id=obj.department_id.id time_start='%s 00:00:00'%(date_from) time_stop='%s 23:59:59'%(date_to) @@ -69,6 +72,8 @@ class VisitBoard(Model): dom.append(['cycle_id','=',cycle_id]) if doctor_id: dom.append(['doctor_id','=',doctor_id]) + if department_id: + dom.append(['department_id','=',department_id]) lines=[] empty_line={