From 65e960d21c934934d095c460a0c4524822185c3f Mon Sep 17 00:00:00 2001 From: "watcha.h" Date: Mon, 8 Feb 2016 15:50:05 +0700 Subject: [PATCH] prevent to put price to zero in case SSO --- netforce_clinic/models/hd_case.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/netforce_clinic/models/hd_case.py b/netforce_clinic/models/hd_case.py index 11d1fc5..d4532e9 100644 --- a/netforce_clinic/models/hd_case.py +++ b/netforce_clinic/models/hd_case.py @@ -1149,6 +1149,11 @@ class HDCase(Model): def done(self,ids,context={}): obj=self.browse(ids)[0] + if obj.patient_type_id.code=='SSO': + for line in obj.lines: + prod=line.product_id + if not line.price and prod: + raise Exception("Can not complete HDCase because price of product %s is missing!"%(prod.name)) count=0 for sline in obj.staffs: if sline.staff_id: