conv_bal
watcha.h 2014-10-05 15:36:58 +07:00
parent 12a365c2d6
commit 7224b72948
2 changed files with 4 additions and 1 deletions

View File

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

View File

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