From fae65fe0fcdcd436313bca4d73ec31ece03e9f8c Mon Sep 17 00:00:00 2001 From: "watcha.h" Date: Sun, 26 Oct 2014 07:15:13 +0700 Subject: [PATCH] list hd case in dialyzer --- netforce_clinic/layouts/clinic_dialyzer_form.xml | 1 + netforce_clinic/layouts/clinic_nurse_form.xml | 1 + netforce_clinic/models/dialyzer.py | 2 ++ netforce_clinic/models/hd_case.py | 2 ++ netforce_clinic/models/hd_case_line.py | 2 +- netforce_clinic/models/nurse.py | 1 + netforce_clinic/models/visit.py | 7 +++---- netforce_clinic/todo.txt | 6 ++---- 8 files changed, 13 insertions(+), 9 deletions(-) diff --git a/netforce_clinic/layouts/clinic_dialyzer_form.xml b/netforce_clinic/layouts/clinic_dialyzer_form.xml index a2d9cc7..90e67cd 100644 --- a/netforce_clinic/layouts/clinic_dialyzer_form.xml +++ b/netforce_clinic/layouts/clinic_dialyzer_form.xml @@ -28,5 +28,6 @@ + diff --git a/netforce_clinic/layouts/clinic_nurse_form.xml b/netforce_clinic/layouts/clinic_nurse_form.xml index 18ec503..e7c3ef8 100644 --- a/netforce_clinic/layouts/clinic_nurse_form.xml +++ b/netforce_clinic/layouts/clinic_nurse_form.xml @@ -15,6 +15,7 @@ + diff --git a/netforce_clinic/models/dialyzer.py b/netforce_clinic/models/dialyzer.py index 85a57a2..9e405a1 100644 --- a/netforce_clinic/models/dialyzer.py +++ b/netforce_clinic/models/dialyzer.py @@ -9,6 +9,7 @@ class Dialyzer(Model): _audit_log=True _name_field="number" _multi_company=True + _fields={ "number": fields.Char("Number",required=True,search=True), "description": fields.Text("Description",search=True), @@ -28,6 +29,7 @@ class Dialyzer(Model): "patient_id": fields.Many2One("clinic.patient","Patient"), "visit_id": fields.Many2One("clinic.visit","Visit"), "hd_case_id": fields.Many2One("clinic.hd.case","HD Case"), + "hd_cases": fields.One2Many("clinic.hd.case","dlz_id","HD Case"), #TODO funtion to get hd case } def _get_number(self,context={}): diff --git a/netforce_clinic/models/hd_case.py b/netforce_clinic/models/hd_case.py index 08744e3..cbddf46 100644 --- a/netforce_clinic/models/hd_case.py +++ b/netforce_clinic/models/hd_case.py @@ -72,6 +72,7 @@ class HDCase(Model): 'pay_date': fields.Date("Pay Date"), 'pay_account_id': fields.Many2One("account.account","Account"), 'payment_id': fields.Many2One("account.payment","Payment"), # for print + 'dlz_id': fields.Many2One("clinic.dialyzer","Dialyzer"), # for link } def _get_number(self,context={}): @@ -134,6 +135,7 @@ class HDCase(Model): line["bid_flow_rate"]=dialyzer.bid_flow_rate line["ultrafittration"]=dialyzer.ultrafittration line["state"]=dialyzer.state + data['dlz_id']=dialyzer.id return data def onchange_patient(self,context={}): diff --git a/netforce_clinic/models/hd_case_line.py b/netforce_clinic/models/hd_case_line.py index 49025da..c6aa611 100644 --- a/netforce_clinic/models/hd_case_line.py +++ b/netforce_clinic/models/hd_case_line.py @@ -10,7 +10,7 @@ class Hdcaseline(Model): "uom_id": fields.Many2One("uom","UOM",required=True,search=True), "price":fields.Float("Price"), "amount":fields.Float("Amount"), - "type": fields.Selection([("fee","Fee"),("other","Other")],"Type",required=True), + "type": fields.Selection([("fee","Fee"),("other","Other"),("service","Service")],"Type",required=True), } _defaults={ diff --git a/netforce_clinic/models/nurse.py b/netforce_clinic/models/nurse.py index 2ccf50f..0f3af7e 100644 --- a/netforce_clinic/models/nurse.py +++ b/netforce_clinic/models/nurse.py @@ -44,6 +44,7 @@ class Nurse(Model): "user_id": fields.Many2One("base.user","User"), 'picture': fields.File("Picture"), 'note': fields.Text("Note"), + 'categ_id': fields.Many2One("product.categ","Category"), } def _get_number(self,context={}): diff --git a/netforce_clinic/models/visit.py b/netforce_clinic/models/visit.py index 585aad1..20a2fa1 100644 --- a/netforce_clinic/models/visit.py +++ b/netforce_clinic/models/visit.py @@ -90,9 +90,6 @@ class Visit(Model): } _order="id desc" - def get_dialyzer(self): - return - def confirm(self,ids,context={}): obj=self.browse(ids[0]) number=obj.number @@ -119,7 +116,9 @@ class Visit(Model): 'dialyzers': [], 'state': 'draft', } - + + # search dialyzer and count automatically + # search Nurse with category products=get_model("product").search_browse([['code','=','FEE']]) for product in products: vals['lines'].append(('create',{ diff --git a/netforce_clinic/todo.txt b/netforce_clinic/todo.txt index 623c265..881e19b 100644 --- a/netforce_clinic/todo.txt +++ b/netforce_clinic/todo.txt @@ -1,7 +1,5 @@ -=== - - skip holiday - -> mum - - +==== + find dialyzer automatic after confirm visit ==== - import data - payment