From d5d6e2ff0e42853cbade251abf914b345eb9b359 Mon Sep 17 00:00:00 2001
From: "olt@tinyerp.com" <>
Date: Fri, 22 Oct 2010 15:18:12 +0200
Subject: [PATCH] [FIX] crm.meeting: 'duration' is no longer readonly [FIX]
base_calendar: bug when trying to set 'allday'
bzr revid: olt@tinyerp.com-20101022131812-1wmx8crh6cdlhodt
---
addons/base_calendar/base_calendar.py | 8 +++-----
addons/crm/crm_meeting_view.xml | 2 +-
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py
index c4c719c5008..326ed33b83d 100644
--- a/addons/base_calendar/base_calendar.py
+++ b/addons/base_calendar/base_calendar.py
@@ -954,10 +954,8 @@ class calendar_event(osv.osv):
value['duration'] = duration
if allday: # For all day event
- value = {
- 'duration': 24
- }
- duration = 0.0
+ value = {'duration': 24}
+ duration = 24.0
start = datetime.strptime(start_date, "%Y-%m-%d %H:%M:%S")
if end_date and not duration:
@@ -968,7 +966,7 @@ class calendar_event(osv.osv):
elif not end_date:
end = start + timedelta(hours=duration)
value['date_deadline'] = end.strftime("%Y-%m-%d %H:%M:%S")
- elif end_date and duration:
+ elif end_date and duration and not allday:
# we have both, keep them synchronized:
# set duration based on end_date (arbitrary decision: this avoid
# getting dates like 06:31:48 instead of 06:32:00)
diff --git a/addons/crm/crm_meeting_view.xml b/addons/crm/crm_meeting_view.xml
index 163a2f5878a..a028e3e0e64 100644
--- a/addons/crm/crm_meeting_view.xml
+++ b/addons/crm/crm_meeting_view.xml
@@ -37,7 +37,7 @@
+ on_change="onchange_dates(date,duration,False,allday)" />