From d5c27ec6ccee19ae7530eafef340de1ecc492a7d 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 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/netforce_clinic/models/labor_cost.py b/netforce_clinic/models/labor_cost.py index 8606871..1a09a25 100644 --- a/netforce_clinic/models/labor_cost.py +++ b/netforce_clinic/models/labor_cost.py @@ -140,7 +140,8 @@ class LaborCost(Model): 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 %s for %s"%(nurse.name,item.name)) levels[level.id]['total']+=1 @@ -281,7 +282,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