[Fix] CRM: if date_deadline is exists then calcuatle the duration

bzr revid: sbh@tinyerp.com-20100119135857-jzet3e1vkz0xupbj
This commit is contained in:
sbh (Open ERP)
2010-01-19 19:28:57 +05:30
parent ed809c3104
commit bee0d0e6b5
+5 -4
View File
@@ -72,10 +72,11 @@ class crm_meeting(osv.osv):
res = {}
for meeting in self.browse(cr, uid, ids, context=context):
start = datetime.strptime(meeting.date, "%Y-%m-%d %H:%M:%S")
end = datetime.strptime(meeting.date_deadline[:19], "%Y-%m-%d %H:%M:%S")
diff = end - start
duration = float(diff.days)* 24 + (float(diff.seconds) / 3600)
res[meeting.id] = round(duration, 2)
if meeting.date_deadline:
end = datetime.strptime(meeting.date_deadline[:19], "%Y-%m-%d %H:%M:%S")
diff = end - start
duration = float(diff.days)* 24 + (float(diff.seconds) / 3600)
res[meeting.id] = round(duration, 2)
return res
def _set_duration(self, cr, uid, id, name, value, arg, context):