fix
parent
12a365c2d6
commit
7224b72948
|
@ -373,6 +373,7 @@ class HDcase(Model):
|
|||
def new_visit(self,ids,context={}):
|
||||
obj=self.browse(ids[0])
|
||||
skip_plan_id=0
|
||||
plane=None
|
||||
for plane in obj.planes:
|
||||
if plane.state=='close':
|
||||
continue
|
||||
|
|
|
@ -291,13 +291,15 @@ class Visit(Model):
|
|||
|
||||
def onchange_date_visit(self,context={}):
|
||||
data=context["data"]
|
||||
timenow=time.strftime("%Y-%m-%d")
|
||||
timenow=time.strftime("%H:%M:%S")
|
||||
date_visit=data['date_visit']
|
||||
fmt_date="%Y-%m-%d %H:%M:%S"
|
||||
time_start=datetime.datetime.strptime("%s %s"%(date_visit,timenow),fmt_date)
|
||||
print("time_start ", time_start)
|
||||
time_use=data['time_use']
|
||||
seconds=(time_use or 1)*3600
|
||||
time_stop=time_start+datetime.timedelta(seconds=seconds)
|
||||
data['time_start']=time_start.strftime(fmt_date)
|
||||
data['time_stop']=time_stop.strftime(fmt_date)
|
||||
return data
|
||||
|
||||
|
|
Loading…
Reference in New Issue