[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>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user