Nicolas Martinelli
b37416376b
[FIX] google_calendar: rrule crash
...
Consider the following:
``` python
from datetime import datetime
from dateutil import rrule
import pytz
dt = pytz.UTC.localize(datetime(2016, 9, 2, 15, 42, 43, 205))
rset = rrule.rrulestr('FREQ=WEEKLY;INTERVAL=2;BYDAY=SU,FR,SA', dtstart=dt, forceset=True, tzinfos={})
test = [d for d in rset]
```
This will generate the following error:
```
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/dateutil/rrule.py", line 1164, in _iter
advance_iterator(ritem)
File "/usr/lib/python2.7/dist-packages/dateutil/rrule.py", line 1091, in __next__
self.dt = advance_iterator(self.gen)
File "/usr/lib/python2.7/dist-packages/dateutil/rrule.py", line 649, in _iter
date = datetime.date.fromordinal(ii.yearordinal+i)
ValueError: year is out of range
```
If such an event is received from Google Calendar, the synchronization
crashes. To avoid this, we enforce a `COUNT` condition if the latter or
`UNTIL` is not explicitly specified. This gives:
``` python
rset = rrule.rrulestr('FREQ=WEEKLY;INTERVAL=2;BYDAY=SU,FR,SA;COUNT=100', dtstart=dt, forceset=True, tzinfos={})
```
Note that this was supposed to be fixed in
https://github.com/odoo/odoo/blob/9dcc32c3041e7ad3549a09c5ed68ee3ef22c7a26/addons/calendar/models/calendar.py#L1287
However, this was working with the old API. The new API and its computed
fields does something different:
1. create the calendar event with the provided `rrule`
2. trigger the inverse method `_inverse_rrule` => `count=100` is added
to the computed parameters
3. however, doing so won't recompute `rrule` for obvious reasons (it was
the initial value provided, so we don't recompute it)
4. the crash is met in `_get_recurrent_date_by_event` when using
`self.rrule`
The fundamental issue is that `_inverse_rrule` is not strictly the
inverse of `_compute_rrule`.
Fixes #25189
opw-1861658
2018-08-07 09:02:44 +02:00
..
2018-08-05 04:05:24 +02:00
2018-08-05 04:05:24 +02:00
2018-08-06 11:32:12 +02:00
2018-08-05 04:05:24 +02:00
2018-08-05 04:05:24 +02:00
2018-08-05 00:28:35 +02:00
2018-07-27 14:02:35 +02:00
2018-08-05 00:28:35 +02:00
2018-07-22 04:09:21 +02:00
2018-07-27 14:02:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-07-29 00:26:54 +02:00
2018-07-22 04:09:21 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-07-30 11:44:31 +02:00
2018-08-05 00:28:35 +02:00
2018-07-24 10:45:46 +02:00
2018-07-24 10:45:46 +02:00
2018-07-24 10:45:46 +02:00
2018-08-05 00:28:35 +02:00
2018-07-29 00:26:54 +02:00
2018-07-22 04:09:21 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-07-29 00:26:54 +02:00
2018-07-24 10:45:46 +02:00
2018-07-24 10:45:46 +02:00
2018-07-24 09:54:29 +02:00
2018-08-06 10:24:31 +02:00
2018-08-05 00:28:35 +02:00
2018-08-07 09:02:44 +02:00
2018-07-22 04:09:21 +02:00
2018-07-22 04:09:21 +02:00
2018-08-06 09:41:49 +02:00
2018-07-22 04:09:21 +02:00
2018-07-22 04:09:21 +02:00
2018-07-24 10:45:46 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-07-22 04:09:21 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-07-29 00:26:54 +02:00
2018-07-22 04:09:21 +02:00
2018-08-05 00:28:35 +02:00
2018-07-29 00:26:54 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-07-24 10:45:46 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-07-24 10:45:46 +02:00
2018-07-13 17:46:12 +02:00
2018-07-13 15:10:12 +02:00
2018-07-13 15:10:12 +02:00
2018-07-13 15:10:12 +02:00
2018-07-24 10:45:46 +02:00
2018-08-05 00:28:35 +02:00
2018-07-24 10:45:46 +02:00
2018-07-24 10:45:46 +02:00
2018-07-24 10:45:46 +02:00
2018-07-24 10:45:46 +02:00
2018-07-24 10:45:46 +02:00
2018-07-24 10:45:46 +02:00
2018-07-24 10:45:46 +02:00
2018-06-21 10:57:42 +02:00
2018-07-24 10:45:46 +02:00
2018-07-24 10:45:46 +02:00
2018-07-26 15:15:12 +02:00
2018-07-26 15:14:17 +02:00
2018-07-26 15:14:17 +02:00
2018-07-24 10:45:46 +02:00
2018-07-24 17:43:33 +02:00
2018-07-24 10:45:46 +02:00
2018-07-24 10:45:46 +02:00
2018-07-24 10:45:46 +02:00
2018-08-05 00:28:35 +02:00
2018-07-24 10:45:46 +02:00
2018-06-13 18:13:48 +02:00
2018-07-24 10:45:46 +02:00
2018-07-24 10:45:46 +02:00
2018-07-24 10:45:46 +02:00
2018-07-24 10:45:46 +02:00
2018-07-24 10:45:46 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-07-22 04:09:21 +02:00
2018-07-22 04:09:21 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-06 13:50:22 +02:00
2018-07-24 10:45:46 +02:00
2018-07-22 04:09:21 +02:00
2018-08-05 00:28:35 +02:00
2018-07-22 04:09:21 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-07-22 04:09:21 +02:00
2018-08-06 14:45:40 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-07-24 10:45:46 +02:00
2018-08-05 00:28:35 +02:00
2018-07-22 04:09:21 +02:00
2018-08-05 00:28:35 +02:00
2018-07-22 04:09:21 +02:00
2018-07-22 04:09:21 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-07-29 00:26:54 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-07-22 04:09:21 +02:00
2018-08-06 13:18:26 +02:00
2018-07-29 00:26:54 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-07 07:36:49 +02:00
2018-08-06 09:52:04 +02:00
2018-08-05 00:28:35 +02:00
2018-07-22 04:09:21 +02:00
2018-07-22 04:09:21 +02:00
2018-07-24 10:45:46 +02:00
2018-07-24 10:45:46 +02:00
2018-08-05 00:28:35 +02:00
2018-07-27 14:02:35 +02:00
2018-07-22 04:09:21 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-07-22 04:09:21 +02:00
2018-08-06 15:51:25 +02:00
2018-08-06 15:23:27 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-07-24 10:45:46 +02:00
2018-08-05 00:28:35 +02:00
2018-07-24 10:45:46 +02:00
2018-07-24 10:45:46 +02:00
2018-07-24 10:45:46 +02:00
2018-07-22 04:09:21 +02:00
2018-07-29 00:26:54 +02:00
2018-08-06 10:24:31 +02:00
2018-07-29 00:26:54 +02:00
2018-08-06 16:17:48 +02:00
2018-07-22 04:09:21 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-06 14:45:40 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-07-29 00:26:54 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-07-22 04:09:21 +02:00
2018-07-24 10:45:46 +02:00
2018-08-05 00:28:35 +02:00
2018-07-22 04:09:21 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-07-22 04:09:21 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-07-31 09:44:03 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00
2018-08-05 00:28:35 +02:00