diff --git a/netforce_clinic/layouts/clinic_cycle_item_list.xml b/netforce_clinic/layouts/clinic_cycle_item_list.xml
index 4be1752..a2acc2f 100644
--- a/netforce_clinic/layouts/clinic_cycle_item_list.xml
+++ b/netforce_clinic/layouts/clinic_cycle_item_list.xml
@@ -6,6 +6,7 @@
+
diff --git a/netforce_clinic/layouts/clinic_menu_inherit.xml b/netforce_clinic/layouts/clinic_menu_inherit.xml
index dea2d08..a63136f 100644
--- a/netforce_clinic/layouts/clinic_menu_inherit.xml
+++ b/netforce_clinic/layouts/clinic_menu_inherit.xml
@@ -4,7 +4,7 @@
-
+
diff --git a/netforce_clinic/layouts/clinic_report_payment_matching.xml b/netforce_clinic/layouts/clinic_report_payment_matching.xml
index 8880196..5ec0411 100644
--- a/netforce_clinic/layouts/clinic_report_payment_matching.xml
+++ b/netforce_clinic/layouts/clinic_report_payment_matching.xml
@@ -3,10 +3,6 @@
-
-
-
-
-
-
+
+
diff --git a/netforce_clinic/models/account_invoice.py b/netforce_clinic/models/account_invoice.py
index e1917ee..f74220a 100644
--- a/netforce_clinic/models/account_invoice.py
+++ b/netforce_clinic/models/account_invoice.py
@@ -4,6 +4,7 @@ class AccountInvoice(Model):
_inherit="account.invoice"
_fields={
'clinic_expense_id': fields.Many2One("clinic.hd.case.expense","Expense"),
+ 'department_id': fields.Many2One("clinic.department","Department",search=True),
}
AccountInvoice.register()
diff --git a/netforce_clinic/models/cycle_item.py b/netforce_clinic/models/cycle_item.py
index 7d11f53..953d8b2 100644
--- a/netforce_clinic/models/cycle_item.py
+++ b/netforce_clinic/models/cycle_item.py
@@ -10,7 +10,7 @@ class CycleItem(Model):
_name_field="name"
_multi_company=True
- def _get_all(self,ids,context={}):
+ def _get_store(self,ids,context={}):
res={}
for obj in self.browse(ids):
cycle=obj.cycle_id
@@ -25,20 +25,29 @@ class CycleItem(Model):
}
return res
+ def _get_all(self,ids,context={}):
+ res={}
+ for obj in self.browse(ids):
+ res[obj.id]={
+ 'nurse_total': len(obj.lines),
+ }
+ return res
+
_fields={
- 'name': fields.Char("Name",function="_get_all",function_multi=True,store=True),
+ 'name': fields.Char("Name",function="_get_store",function_multi=True,store=True),
'date': fields.Date("Date",search=True),
'cycle_id': fields.Many2One("clinic.cycle", "Cycle",search=True),
'visits': fields.One2Many("clinic.visit","cycle_item_id", "Visits"),
'hd_cases': fields.One2Many("clinic.hd.case","cycle_item_id", "HD Cases"),
'lines': fields.One2Many("clinic.cycle.item.line",'cycle_item_id','Nurses'),
- 'sequence': fields.Char("Sequence",function="_get_all",function_multi=True,store=True),
+ 'sequence': fields.Char("Sequence",function="_get_store",function_multi=True,store=True),
'user_id': fields.Many2One("base.user","Validator"),
'company_id': fields.Many2One("company", "Company"),
'branch_id': fields.Many2One("clinic.branch", "Branch",search=True),
'department_id': fields.Many2One("clinic.department", "Department",search=True),
"comments": fields.One2Many("message","related_id","Comments"), "company_id": fields.Many2One("company","Company"),
"state": fields.Selection([("draft","Draft"),("validated","Validated")],"Status",required=True),
+ 'nurse_total': fields.Integer("Total (Nurse)",function="_get_all",function_multi=True),
}
def _get_branch(self,context={}):
diff --git a/netforce_clinic/models/dialyzer.py b/netforce_clinic/models/dialyzer.py
index 220ec6c..9309e2b 100644
--- a/netforce_clinic/models/dialyzer.py
+++ b/netforce_clinic/models/dialyzer.py
@@ -25,9 +25,9 @@ class Dialyzer(Model):
"company_id": fields.Many2One("company","Company"),
'product_id': fields.Many2One("product", "Product",required=True),
"pickings": fields.One2Many("stock.picking","related_id","Pickings"),
- "patient_id": fields.Many2One("clinic.patient","Patient"),
- "visit_id": fields.Many2One("clinic.visit","Visit"),
- "hd_case_id": fields.Many2One("clinic.hd.case","HD Case"),
+ "patient_id": fields.Many2One("clinic.patient","Patient",search=True),
+ "visit_id": fields.Many2One("clinic.visit","Visit",search=True),
+ "hd_case_id": fields.Many2One("clinic.hd.case","HD Case",search=True),
"hd_cases": fields.One2Many("clinic.hd.case","dlz_id","HD Case"), #TODO funtion to get hd case
'department_id': fields.Many2One("clinic.department","Department",search=True),
}
diff --git a/netforce_clinic/models/hd_case.py b/netforce_clinic/models/hd_case.py
index 5e19928..3502fd3 100644
--- a/netforce_clinic/models/hd_case.py
+++ b/netforce_clinic/models/hd_case.py
@@ -435,7 +435,8 @@ class HDCase(Model):
"inv_type": "invoice",
"tax_type": "tax_in",
'due_date': due_date,
- "ref": obj.number,
+ "ref": '%s (%s)'%(patient.name or '',patient.number or ''),
+ 'department_id': obj.department_id.id,
"related_id": "clinic.hd.case,%s"%obj.id,
"currency_id": currency_id,
"company_id": company_id,
diff --git a/netforce_clinic/models/visit_board.py b/netforce_clinic/models/visit_board.py
index 96e19b6..101b351 100644
--- a/netforce_clinic/models/visit_board.py
+++ b/netforce_clinic/models/visit_board.py
@@ -161,7 +161,7 @@ class VisitBoard(Model):
department=visit.department_id
if not branch:
branch=department.branch_id
-
+
hn_name=patient.hn_no or '-'
visit_date=visit.visit_date
@@ -183,8 +183,8 @@ class VisitBoard(Model):
'cycle_color': cycle.color,
'department_id': department.id,
'department_name': department.name or '',
- 'branch_id': branch.id,
- 'branch_name': branch.name or '',
+ 'branch_id': branch and branch.id or None,
+ 'branch_name': branch and branch.name or '',
'patient_name': patient.name,
'patient_id': patient.id,
'patient_type': patient.type_id.name or "",