Skip to content

Commit 004f7ae

Browse files
committed
[FIX] google_calendar: Wrong timezone on cron synchronization
Issue - Install "Calendar" app - Activate & Set google calendar credidentials - Go to user preference - Edit and set timezone "Europe/Brussels" e.g. - Go to calendar app - Add an event and sync with google - Go to Settings->Technical->Automation->Scheduled Actions - Edit Google Calendar: synchronization - Set "Next Execution Date" ASAP The timezone on Google Calendar synchronised event is: - Before cron: GMT +2 - After cron: UTC Cause If no timezone is provided in context, it will by default use 'UTC' timezone. Solution Like display time on odoo, if no timezone is provided in context, it will check the env.user timezone instead. opw-2228296 closes odoo#51849 X-original-commit: 41372db Signed-off-by: Nicolas Martinelli (nim) <[email protected]>
1 parent 7271d83 commit 004f7ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

addons/google_calendar/models/google_calendar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,12 +225,12 @@ def generate_data(self, event, isCreating=False):
225225
"start": {
226226
type: start_date,
227227
vstype: None,
228-
'timeZone': self.env.context.get('tz') or 'UTC',
228+
'timeZone': self.env.context.get('tz') or self.env.user.tz or 'UTC',
229229
},
230230
"end": {
231231
type: final_date,
232232
vstype: None,
233-
'timeZone': self.env.context.get('tz') or 'UTC',
233+
'timeZone': self.env.context.get('tz') or self.env.user.tz or 'UTC',
234234
},
235235
"attendees": attendee_list,
236236
"reminders": {

0 commit comments

Comments
 (0)