From b91f11c93a2c5b6fc62bac41277c72fe343fb706 Mon Sep 17 00:00:00 2001 From: "watcha.h" Date: Sun, 2 Nov 2014 01:17:40 +0700 Subject: [PATCH] cycle item --- .../layouts/clinic_cycle_item_form.xml | 14 ++++++++++++++ .../layouts/clinic_gen_visit_form.xml | 2 +- netforce_clinic/models/__init__.py | 2 ++ netforce_clinic/models/cycle_item.py | 2 ++ netforce_clinic/models/cycle_item_doctor.py | 18 ++++++++++++++++++ netforce_clinic/models/cycle_item_nurse.py | 18 ++++++++++++++++++ 6 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 netforce_clinic/models/cycle_item_doctor.py create mode 100644 netforce_clinic/models/cycle_item_nurse.py diff --git a/netforce_clinic/layouts/clinic_cycle_item_form.xml b/netforce_clinic/layouts/clinic_cycle_item_form.xml index a8f8901..6416391 100644 --- a/netforce_clinic/layouts/clinic_cycle_item_form.xml +++ b/netforce_clinic/layouts/clinic_cycle_item_form.xml @@ -4,8 +4,22 @@ + + + + + + + + + + + + + + diff --git a/netforce_clinic/layouts/clinic_gen_visit_form.xml b/netforce_clinic/layouts/clinic_gen_visit_form.xml index 1a8493e..c898093 100644 --- a/netforce_clinic/layouts/clinic_gen_visit_form.xml +++ b/netforce_clinic/layouts/clinic_gen_visit_form.xml @@ -6,9 +6,9 @@ + - diff --git a/netforce_clinic/models/__init__.py b/netforce_clinic/models/__init__.py index 5569853..141dd71 100644 --- a/netforce_clinic/models/__init__.py +++ b/netforce_clinic/models/__init__.py @@ -29,6 +29,8 @@ from . import dialyzer_line from . import import_payment from . import cycle from . import cycle_item +from . import cycle_item_nurse +from . import cycle_item_doctor from . import cycle_item_line from . import gen_visit from . import gen_visit_line diff --git a/netforce_clinic/models/cycle_item.py b/netforce_clinic/models/cycle_item.py index 6c1d59f..e2ace99 100644 --- a/netforce_clinic/models/cycle_item.py +++ b/netforce_clinic/models/cycle_item.py @@ -25,6 +25,8 @@ class CycleItem(Model): "state": fields.Selection([("draft","Draft"),("done","Done")],"Status",required=True), 'hd_cases': fields.One2Many("clinic.hd.case","cycle_item_id", "HD Cases"), 'visits': fields.One2Many("clinic.visit","cycle_item_id", "Visits"), + 'nurses': fields.One2Many("clinic.cycle.item.nurse",'cycle_item_id','Nurses'), + 'doctors': fields.One2Many("clinic.cycle.item.doctor",'cycle_item_id','Doctors'), } _defaults={ diff --git a/netforce_clinic/models/cycle_item_doctor.py b/netforce_clinic/models/cycle_item_doctor.py new file mode 100644 index 0000000..99dacf1 --- /dev/null +++ b/netforce_clinic/models/cycle_item_doctor.py @@ -0,0 +1,18 @@ +from netforce.model import Model, fields, get_model +from netforce.access import get_active_company + +class CycleItemDoctor(Model): + _name="clinic.cycle.item.doctor" + _string="Cycle Item Doctor" + + _fields={ + 'cycle_item_id': fields.Many2One("clinic.cycle.item", "Cycle Item"), + 'categ_id': fields.Many2One("clinic.personal.categ", "Category",), + 'doctor_id': fields.Many2One("clinic.personal",'Doctor',domain=[['type','=','doctor']]), + } + + _defaults={ + "company_id": lambda *a: get_active_company(), + } + +CycleItemDoctor.register() diff --git a/netforce_clinic/models/cycle_item_nurse.py b/netforce_clinic/models/cycle_item_nurse.py new file mode 100644 index 0000000..ce513e8 --- /dev/null +++ b/netforce_clinic/models/cycle_item_nurse.py @@ -0,0 +1,18 @@ +from netforce.model import Model, fields, get_model +from netforce.access import get_active_company + +class CycleItemNurse(Model): + _name="clinic.cycle.item.nurse" + _string="Cycle Item Nurse" + + _fields={ + 'cycle_item_id': fields.Many2One("clinic.cycle.item", "Cycle Item"), + 'categ_id': fields.Many2One("clinic.personal.categ", "Category",), + 'nurse_id': fields.Many2One("clinic.personal",'Nurse',domain=[['type','=','nurse']]), + } + + _defaults={ + "company_id": lambda *a: get_active_company(), + } + +CycleItemNurse.register()