recompute labor cost in case to draft

production
watcha.h 2015-11-24 11:03:36 +07:00
parent 1b1448f73e
commit 091e327db3
2 changed files with 5 additions and 0 deletions

View File

@ -1058,6 +1058,10 @@ class HDCase(Model):
def undo(self,ids,context={}):
obj=self.browse(ids)[0]
# recompute labor cost
lc=get_model("clinic.labor.cost").search_browse([['cycle_item_id','=',obj.cycle_item_id.id]])
if lc:
lc.compute()
context['is_decrease']=True
# in case to draft
obj.update_usetime(context=context)

View File

@ -134,6 +134,7 @@ class ReportLaborCostSummary(Model):
dpt=citem.department_id
qty=line.qty or 0
total_hdcase+=qty
print("total_hdcase ", total_hdcase)
amt=line.amount or 0
staff=line.staff_id
categ_name=''