Merge lp:~openerp-dev/openobject-addons/7.0-opw-593929-msh into lp:openobject-addons/7.0

Proposed by Mohammed Shekha(Open ERP)
Status: Merged
Approved by: Naresh(OpenERP)
Approved revision: no longer in the source branch.
Merged at revision: 9930
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-opw-593929-msh
Merge into: lp:openobject-addons/7.0
Diff against target: 12 lines (+1/-1)
1 file modified
base_calendar/base_calendar.py (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-opw-593929-msh
Reviewer Review Type Date Requested Status
Martin Trigaux (OpenERP) (community) Approve
Naresh(OpenERP) (community) Approve
Review via email: mp+171962@code.launchpad.net

Description of the change

Hello,

Fixed the issue of rrule(recurrent rule) string, which adds Z at the end of rrule when recurrent rule created based on End Date, Z is added for timezone by default to UTC, but it is not required as we are sending static time 23:59:59, and rrule of dateutil not going to change the timezone, untill if you specifically provided tzinfo or timezone difference valuelike +03:00 explicitly.

Demo:- Got o Messaging -> Organizer -> Calendar -> Create one event with recurrent rule, and set recurrent rule, Until End date and give any end date.

Now check Scheduled Actions -> Run Event Reminder which calls do_run_scheduler method of calendar.alarm at every 1 minute, and check for the reminder, compute_rule_string based on month, week or end date, if there is rrule is based on end date then we added Z at the end of UNTIL attribute, now when this rrule going to parse by dateutil parser it fails to compare start date(which is with tzinfo in UTC format) and one with tzinfo that is our End date(given in UNTIL) due to which job fails to run.

There is no need of 'Z' as we passing static time and if dateutil parser modifies the time when explicitly tzinfo given other UNTIL date keeps as it is, so removed 'Z' from the rrule, correct me if I am wrong.

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) :
review: Approve
Revision history for this message
Martin Trigaux (OpenERP) (mat-openerp) wrote :

LGTM, merged in 7.0

revno: 9929 [merge]
revision-id: <email address hidden>

review: Approve

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 2013-06-20 13:21:32 +0000
+++ base_calendar/base_calendar.py 2013-06-28 07:26:46 +0000
@@ -1269,7 +1269,7 @@
12691269
1270 def get_end_date(data):1270 def get_end_date(data):
1271 if data.get('end_date'):1271 if data.get('end_date'):
1272 data['end_date_new'] = ''.join((re.compile('\d')).findall(data.get('end_date'))) + 'T235959Z'1272 data['end_date_new'] = ''.join((re.compile('\d')).findall(data.get('end_date'))) + 'T235959'
12731273
1274 return (data.get('end_type') == 'count' and (';COUNT=' + str(data.get('count'))) or '') +\1274 return (data.get('end_type') == 'count' and (';COUNT=' + str(data.get('count'))) or '') +\
1275 ((data.get('end_date_new') and data.get('end_type') == 'end_date' and (';UNTIL=' + data.get('end_date_new'))) or '')1275 ((data.get('end_date_new') and data.get('end_type') == 'end_date' and (';UNTIL=' + data.get('end_date_new'))) or '')