From eb4f63e3c6f0f8d64fc0b136f8ceffbe68418773 Mon Sep 17 00:00:00 2001 From: "watcha.h" Date: Mon, 23 Nov 2015 16:29:25 +0700 Subject: [PATCH] when compute, it should get level directly from current staff level --- netforce_clinic/models/labor_cost.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/netforce_clinic/models/labor_cost.py b/netforce_clinic/models/labor_cost.py index 8606871..c6f0699 100644 --- a/netforce_clinic/models/labor_cost.py +++ b/netforce_clinic/models/labor_cost.py @@ -281,7 +281,10 @@ class LaborCost(Model): # cost's nurses for line in item.lines: nurse=line.nurse_id - level=line.level_id or nurse.level_id + #level=line.level_id or nurse.level_id + level=nurse.level_id + if not level: + raise Exception("Please specify level for %s"%nurse.name) vals=levels.get(level.id) rate,amt,qty=0.0,0.0,0 level_id=level.id