Merge lp:~openerp-dev/openobject-addons/6.1-opw-579812-rgo into lp:openobject-addons/6.1

Proposed by Ravi Gohil (OpenERP)
Status: Approved
Approved by: Naresh(OpenERP)
Approved revision: 7027
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-579812-rgo
Merge into: lp:openobject-addons/6.1
Diff against target: 70 lines (+20/-13)
1 file modified
base_calendar/base_calendar.py (+20/-13)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-579812-rgo
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email: mp+128489@code.launchpad.net

Description of the change

Hello,

This MP contains fix for below issues:

When you create a meeting for all day, time in start date and end date are not set to 00:00:00 or to 12:00:00 AM.

Currently, when the mail is sent by the event reminder scheduler, `Event Date` is set to alarm's trigger date instead of actual event date.

When synchronizing the invitation.ics file with calendar client, the calendar client shows meeting datetime as it received, that is in UTC, meeting datetime should be converted to local timezone.

Kindly review the fix.

Thanks.

To post a comment you must log in.
7018. By Xavier ALT

[MERGE] OPW 577045: translations: collective fix of missing translation terms in reports

7019. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

7020. By Xavier ALT

[MERGE] OPW 575716: account: force account.financial.report balance of *zero* to be displayed positively

7021. By Xavier ALT

[MERGE] OPW 579553: account: fix traceback when modifing existing journal entry line

7022. By Xavier ALT

[MERGE] OPW 576019: sale/purchase: when changing SO or PO line product, use product's UoM even if current UoM is of the same category

7023. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

7024. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

7025. By Stephane Wirtel (OpenERP)

[FIX] point_of_sale: remove unused file

7026. By Xavier ALT

[MERGE] OPW 578622: project: duplicating project must reset analytic account code

7027. By Ravi Gohil (OpenERP)

[FIX] base_calendar: Synchronizing the invitation.ics file with calendar client shows meeting time in UTC : (Maintenance Case : 579812)

Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

This bug was qualified as Confirmed(partially) on Trunk (means still existing and reproducible). A Merge Proposal for trunk was created to fix it. Here is the link to follow the MP on Launchpad and be informed once it's been merged in trunk: ... If this Merge Proposal could not be merged in v6.1 at the release of v7.0, it will be closed.

Thanks,
Naresh Soni

Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Unmerged revisions

7027. By Ravi Gohil (OpenERP)

[FIX] base_calendar: Synchronizing the invitation.ics file with calendar client shows meeting time in UTC : (Maintenance Case : 579812)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'base_calendar/base_calendar.py'
--- base_calendar/base_calendar.py 2012-03-05 14:35:54 +0000
+++ base_calendar/base_calendar.py 2012-10-11 09:58:22 +0000
@@ -399,11 +399,12 @@
399 @return: .ics file content399 @return: .ics file content
400 """400 """
401 res = None401 res = None
402 def ics_datetime(idate, short=False):402 def ics_datetime(idate, short=False, dtfield=False):
403 if idate:403 if idate:
404 if short or len(idate)<=10:404 if short or len(idate)<=10:
405 return date.fromtimestamp(time.mktime(time.strptime(idate, '%Y-%m-%d')))405 return date.fromtimestamp(time.mktime(time.strptime(idate, '%Y-%m-%d')))
406 else:406 else:
407 dtfield.params['TZID'] = ['UTC']
407 return datetime.strptime(idate, '%Y-%m-%d %H:%M:%S')408 return datetime.strptime(idate, '%Y-%m-%d %H:%M:%S')
408 else:409 else:
409 return False410 return False
@@ -416,9 +417,12 @@
416 event = cal.add('vevent')417 event = cal.add('vevent')
417 if not event_obj.date_deadline or not event_obj.date:418 if not event_obj.date_deadline or not event_obj.date:
418 raise osv.except_osv(_('Warning !'),_("Couldn't Invite because date is not specified!"))419 raise osv.except_osv(_('Warning !'),_("Couldn't Invite because date is not specified!"))
419 event.add('created').value = ics_datetime(time.strftime('%Y-%m-%d %H:%M:%S'))420 dtfield = event.add('created')
420 event.add('dtstart').value = ics_datetime(event_obj.date)421 dtfield.value = ics_datetime(time.strftime('%Y-%m-%d %H:%M:%S'), dtfield=dtfield)
421 event.add('dtend').value = ics_datetime(event_obj.date_deadline)422 dtfield = event.add('dtstart')
423 dtfield.value = ics_datetime(event_obj.date, dtfield=dtfield)
424 dtfield = event.add('dtend')
425 dtfield.value = ics_datetime(event_obj.date_deadline, dtfield=dtfield)
422 event.add('summary').value = event_obj.name426 event.add('summary').value = event_obj.name
423 if event_obj.description:427 if event_obj.description:
424 event.add('description').value = event_obj.description428 event.add('description').value = event_obj.description
@@ -890,7 +894,7 @@
890----894----
891%s895%s
892896
893""" % (alarm.name, alarm.trigger_date, alarm.description, \897""" % (alarm.name, alarm.event_date, alarm.description, \
894 alarm.user_id.name, alarm.user_id.signature)898 alarm.user_id.name, alarm.user_id.signature)
895 mail_to = [alarm.user_id.user_email]899 mail_to = [alarm.user_id.user_email]
896 for att in alarm.attendee_ids:900 for att in alarm.attendee_ids:
@@ -942,16 +946,19 @@
942 duration = 1.00946 duration = 1.00
943 value['duration'] = duration947 value['duration'] = duration
944948
949 start = datetime.strptime(start_date, "%Y-%m-%d %H:%M:%S")
945 if allday: # For all day event950 if allday: # For all day event
946 value = {'duration': 24.0}
947 duration = 24.0951 duration = 24.0
948 if start_date:952 value['duration'] = duration
949 start = datetime.strptime(start_date, "%Y-%m-%d %H:%M:%S")953 # change start_date's time to 00:00:00 in the user's timezone
950 start_date = datetime.strftime(datetime(start.year, start.month, start.day, 0,0,0), "%Y-%m-%d %H:%M:%S")954 user = self.pool.get('res.users').browse(cr, uid, uid)
951 value['date'] = start_date955 tz = pytz.timezone(user.context_tz) if user.context_tz else pytz.utc
952956 start = pytz.utc.localize(start).astimezone(tz) # convert start in user's timezone
953957 start = start.replace(hour=0, minute=0, second=0) # change start's time to 00:00:00
954 start = datetime.strptime(start_date, "%Y-%m-%d %H:%M:%S")958 start = start.astimezone(pytz.utc) # convert start back to utc
959 start_date = start.strftime("%Y-%m-%d %H:%M:%S")
960 value['date'] = start_date
961
955 if end_date and not duration:962 if end_date and not duration:
956 end = datetime.strptime(end_date, "%Y-%m-%d %H:%M:%S")963 end = datetime.strptime(end_date, "%Y-%m-%d %H:%M:%S")
957 diff = end - start964 diff = end - start