diff --git a/netforce_clinic/models/change_visit.py b/netforce_clinic/models/change_visit.py index d4e6e55..3f52e6d 100644 --- a/netforce_clinic/models/change_visit.py +++ b/netforce_clinic/models/change_visit.py @@ -41,6 +41,7 @@ class ChangeVisit(Model): def do_change(self,ids,context): obj=self.browse(ids)[0] + context['branch_id']=obj.department_id.branch_id.id dom=[ ['visit_date','=',obj.visit_date], ['patient_id','=',obj.patient_id.id], @@ -60,7 +61,7 @@ class ChangeVisit(Model): 'time_stop': obj.time_stop, 'visit_date': obj.visit_date, 'state': 'pending', - }) + },context=context) obj.visit_id.to_draft() obj.visit_id.cancel() visit=get_model("clinic.visit").browse(new_id)