summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Castiaux <juc@odoo.com>2019-06-19 14:38:00 +0000
committerJulien Castiaux <juc@odoo.com>2019-06-19 14:38:00 +0000
commit81147140ac4d9bfc3b0a69faa7dd7e773f4e7b54 (patch)
tree5651f5b5d7dffa2f373633242451f36b95eb59c6
parente6b9e6a0320efb9d5124c386d4168b356deabb07 (diff)
[FIX] calendar: shift midnight to current locale
Configure your system to be in the Mexico timezone, configure your Odoo profile accordingly. Go to calendar, show daily events, add an event at the end of the day (like 10pm). The resulting event is not visible on the daily view although it is on the weekly view. The same problem occurs on the weekly view if the event was create late the last day. The problem is the initial `search_read` has a domain to filter the events using 00:00 UTC to 23:59 UTC boundaries. Those boundaries are not locale aware, they should be shifted to the MX timezone. opw-2009877 closes odoo/odoo#34247 Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
-rw-r--r--addons/web/static/src/js/views/calendar/calendar_model.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/calendar/calendar_model.js b/addons/web/static/src/js/views/calendar/calendar_model.js
index 430b72f8a60..1a960b4adbf 100644
--- a/addons/web/static/src/js/views/calendar/calendar_model.js
+++ b/addons/web/static/src/js/views/calendar/calendar_model.js
@@ -271,7 +271,6 @@ return AbstractModel.extend({
this.data.highlight_date = this.data.target_date = start.clone();
// set dates in UTC with timezone applied manually
this.data.start_date = this.data.end_date = start;
- this.data.start_date.utc().add(this.getSession().getTZOffset(this.data.start_date), 'minutes');
switch (this.data.scale) {
case 'month':
@@ -286,6 +285,9 @@ return AbstractModel.extend({
this.data.start_date = this.data.start_date.clone().startOf('day');
this.data.end_date = this.data.end_date.clone().endOf('day');
}
+
+ this.data.start_date.utc();
+ this.data.end_date.utc();
},
/**
* @param {string} scale the scale to set