In case of event not all day, the timezone has an impact.
So if we search for date >= 2016-01-31 (00:00:00) and that the current timezone
is +5, we should search for date >= 2016-01-30 19:00:00.
date_to_str will drop the time.
This commit closes#12878
This commit closes#12971
Commit odoo/odoo@9be7a9535c changes the week number
computation to match calendar and pivot views.
Now, calendar don't use isoWeek format by default, but the weekNumber from locale(),
So we need to adapt also the format for title.
closes#12068, closes#9629
When quickly changing the range in the calendar view, multiple
asynchronous read_slice requests will be launched. The read_slice
returns the records and sets the ids property on the dataset according
to a set domain, context etc.
This creates a race condition because although the read_slice calls will
be launched in the correct order, there is no guarantee that they will
resolve in the correct order. In practice issues will occur quite
frequently on a slower connection and with a big read followed by a
small read. The big read that matches a lot of records will be slower to
complete than the small read which will result in it resolving later
than the small read. This causes the dataset to not be in sync with the
rest of the view. When you click on an affected event everything will
look fine in the popup, but when clicking on edit the form view will
show a new event instead. The reason for this is that switching to the
form view requires a correct dataset.index, which is set by
dataset.get_id_index(id) which won't exist.
A potential way of fixing this would be guaranteeing the order of
read_slice calls by only allowing one of them to be active at a
time. This would not be ideal because you could end up with a long chain
of read_slice calls when changing the range fast on a slow
connection. In theory the UI would have to block as well then.
Instead of that, we will simply ignore responses to out-of-date
requests. This is done by manually resetting the ids property of the
dataset to its previous value when we detect the range of the calendar
has changed since the read_slice call was launched.
opw-673425
To format Week numbers in the pivot view, babel is used with format
`'W'w YYYY` in the current locale (eg: en_US) which will determine
print the week in the locale week numbering type.
This is inconsistant with the fullcalendar version (1.6.4) in Odoo until
at least version 9.0 where ISO is used by default. This behaviour has
been changed in more recent version of fullcalendar and is now in tune
with pivot view, but updating fullcalendar should be done in master.
This commit customize the week numbering on the old version of
fullcalendar getting the yearned result without updating fullcalendar.
This is only possible in saas-6 since momentjs is only present since
saas-6 and is required for this fix.
closes#11522
opw-653671
opw-668711
If an event is moved at another time, its appearance would only be
refreshed if it was successful. But in this particular instance, the
refresh may even be more useful when the change failed.
part of #9837
second half of:
opw-657863