change visit

production
watcha.h 2015-10-17 18:45:06 +07:00
parent 4326614a04
commit dbf0d685c3
1 changed files with 2 additions and 1 deletions

View File

@ -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)