[IMP]event:improved code for set date_end

bzr revid: ssu@tinyerp.com-20121004104130-k85ns056g5dmxkko
This commit is contained in:
Saurang Suthar
2012-10-04 16:11:30 +05:30
parent ff89db5f7c
commit 3530f433bc
+4 -3
View File
@@ -290,12 +290,13 @@ class event_event(osv.osv):
return {'value' : values}
def onchange_start_date(self, cr, uid, ids, date_end, date_begin, context=None):
def onchange_start_date(self, cr, uid, ids, date_end=False, date_begin=False, context=None):
value = {}
if date_begin:
start = datetime.strptime(date_begin, "%Y-%m-%d %H:%M:%S")
date_end = start + timedelta(hours=1.00)
date_begin = datetime.strptime(date_begin, "%Y-%m-%d %H:%M:%S")
date_end = date_begin + timedelta(hours=1.00)
return {'value': {'date_end':date_end.strftime("%Y-%m-%d %H:%M:%S")}}
return {}
# ----------------------------------------
# OpenChatter methods and notifications