prevent to put price to zero in case SSO

stable
watcha.h 2016-02-08 15:50:05 +07:00
parent b9a546e4ca
commit 65e960d21c
1 changed files with 5 additions and 0 deletions

View File

@ -1149,6 +1149,11 @@ class HDCase(Model):
def done(self,ids,context={}): def done(self,ids,context={}):
obj=self.browse(ids)[0] 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 count=0
for sline in obj.staffs: for sline in obj.staffs:
if sline.staff_id: if sline.staff_id: