Commit Graph
16 Commits
Author SHA1 Message Date
Nicolas Lempereur 3d09560ffc [FIX] calendar: keep recurring after edited one
Since 76b7242 if we have a recurring event with 3 occurences:

 [4th 4:00-4th 5:00] [14th 4:00-14th 5:00] [24th 4:00-24th 4:00]

And we detach the first one to modify it, then when getting the
info of reccurring events not detached the system get:

- starts: [14th 4:00] [24th 4:00]
- stops: [4th 5:00] [14th 5:00] [24th 5:00]

And wrongly apply the current filtering over:

 [14th 4:00-4th 5:00] [24th 4:00-14th 5:00]

So the issue hides recurrences of event wrongly if:

- they have not been detached
- they don't have a duration of 0
- one or several previous events have been detached
- the stop date of the nth previous event occurrence (nth equaling
  number of detached previous events) is not in the current filtering.

With this change, the stops are also filtered based on start of
occurrence + duration.

Without the change, the added test fails with:

 False != '27-20120301120100' : Last event should be found searching it by date range

note: 11.0 version of 10.0 #26887

opw-1866151
closes #26901
2018-09-11 16:27:58 +02:00
Christophe Simonis 6c2ab192ea [MERGE] forward port branch saas-16 up to 88a9980b0c 2017-10-10 16:49:59 +02:00
Christophe Simonis 446ff1baf8 [MERGE] forward port branch saas-15 up to b60a41ce14 2017-10-09 17:54:36 +02:00
Jeremy Kersten 7e04e442b1 [FIX] calendar: don't read start_date(time) in read
It seems to randomly save a bad value into the cache for star_date(time) field.

For already impacted database, it can be easily fixed with a simple update.
  update calendar_event set start_datetime=start, stop_datetime=stop where allday = 'f';
  update calendar_event set start_date=start, stop_date=stop where allday = 't';

Than can cause errors for google synchro.
2017-10-03 23:54:31 +02:00
Jeremy Kersten 449805ba5c [FIX] calendar: fix read method to avoid to read computed field start_date(time)
Read(['start', 'start_datetime', 'start_date']) make the cache corrupt
for computed field start_datetime or start_date.

Now we don't read (for nothing ?) these 2 fields.

We can remove the skip for the test #500fabf1

Before this commit, a simple :
x = self.create({'name':'subject', 'allday': False, 'start': foo, 'stop': bar})

create randomly an event withtout start_datetime
2017-10-03 23:35:31 +02:00
Jeremy Kersten 4778e8d006 [IMP] calendar: add assert to debug test 2017-10-03 16:10:20 +02:00
Jeremy Kersten 500fabf13c [FIX] calendar: temporary fix test...
...commenting it while we find the bug.
Branch need to be green for v11
2017-10-03 16:10:19 +02:00
Christophe Simonis 5ce21c7355 [MERGE] forward port branch saas-16 up to b3d0897f2d 2017-10-02 13:05:17 +02:00
Christophe Simonis b3d0897f2d [MERGE] forward port branch saas-15 up to 729cf0e17d 2017-10-02 12:06:22 +02:00
xmo-odoo 82ef2f1b8e [FIX] calendar: validation error when moving some events back
Observed via google sync, for some events being moved around during
sync the stop_datetime ends up being before the start_datetime failing
the sync. Not (explicitly) reading the computed fields from the old
record properly recomputes them during copy.

Underlying issue linked to (stored) computed fields when multiple
fields are computed by the same method *and* the creation provides a
subset of these fields explicitly: depending on the order in
which *recompute* iterates the fields, it's possible that some of the
fields provided explicitly get extracted (from the cache) before
fields not-provided trigger a recomputation (and overwrite) of
computed fields.

In this case `recompute` iterates [start_datetime, start_date,
stop_date, stop_datetime], if `start_datetime` and `stop_datetime` are
provided explicitly to create, first recompute will check for
`start_datetime`, find it in the cache and extract it, then it checks
for `start_date`, does not find it in the cache, calls
`_compute_dates` which writes all four fields, then it extracts the
recomputed `start_datetime`, creating an incoherence: `start_datetime`
is the one from the old event while `stop_datetime` is the one from
the update/computation. This may lead to invisible corruption if the
event is moved forwards (e.g. creates a multi-day event) and triggers
a validation error if the event is moved backwards (stop_datetime is
now before start_datetime).

ping @rco-odoo multi-field computes may need some special handling
with respect to invalidations & sequencing & the like (e.g. check
their caching as a unit or something).

OPW-771886
2017-10-02 10:55:15 +02:00
Olivier Colson 52ed76ec70 [IMP] calendar, lunch: "recurrence" instead of "recurrency" in field labels, templates and comments 2017-10-02 10:42:57 +02:00
Thibault Delavallée 57cba85c0d [IMP] calendar: add test for meeting activities
Those tests are not a complete flow test but at last it tests that
activities and calendar events are correctly created / unlinked.
2017-09-07 17:55:58 +02:00
xmo-odoo 2e6a589f41 [FIX] builtins removed from Python 3
* Reverse wrapper courtesy of @rco-odoo's original P3 branch
* thin compat module stripped down from werkzeug (to augment as needed)

issue 8530
2017-04-27 13:59:33 +02:00
amoyaux 447356f7ee [FIX] calendar: set correct recurring start_date
A recurring event with a start date and a time duration had a wrong start and
stop date computed.

Introduced at 76b724294a.
Previously the r_date contained only the start_date but now it contains both
start and stop dates. This implies that the method 'get_recurrent_ids' could
use 'get_search_fields' with a stop_date (depending on the domain order) and
returns incorrect dates.

This commit ensure to launch the get_search_fields with the start date.

Closes #15922
2017-03-20 10:25:30 +01:00
Martin Trigaux 76b724294a [FIX] calendar: correct search in recurrent event
Add a 3 use cases with tests that were failing before.

datetime filters were not working correctly on stop filters
The `_get_recurrent_date_by_event` was only computing recurrency on the start
field of an event which can make a difference. A recurring event
  start=2017-01-01 09:00:00; stop=2017-01-01 10:00:0
was not matched in a search ('stop', '>', '2017-01-01 09:30:00')

The filter != was not handled in the recurring use cases.
e.g. making the search 'start is set' in the web client is equal to
  ('start', '!=', False)

Searching with only a start filter matching recurring events but not the
first ("real") occurence, was returning no result if no stop filter was present.
  start=2017-01-01 09:00:00; count=5
had no result in a search ('start', '>', '2017-01-02')
2017-03-07 15:57:37 +01:00
Mitali Patel e3560bd310 [REF] calendar: Migrated yml test cases to python unittest 2016-07-14 14:04:34 +02:00