diff --git a/beesdoo_website_shift/__openerp__.py b/beesdoo_website_shift/__openerp__.py index b1a3d09..8f8dfe3 100644 --- a/beesdoo_website_shift/__openerp__.py +++ b/beesdoo_website_shift/__openerp__.py @@ -16,7 +16,7 @@ 'author': 'Rémy Taymans', 'license': 'AGPL-3', - 'version': '9.0.2.0', + 'version': '9.0.2.1', 'website': "https://github.com/beescoop/Obeesdoo", 'category': 'Cooperative management', diff --git a/beesdoo_website_shift/controllers/main.py b/beesdoo_website_shift/controllers/main.py index 76fc93c..ab011c7 100644 --- a/beesdoo_website_shift/controllers/main.py +++ b/beesdoo_website_shift/controllers/main.py @@ -45,8 +45,13 @@ class WebsiteShiftController(http.Controller): # Ensure that the datetime given is without a timezone assert datetime.tzinfo is None # Get current user and user timezone + # Take user tz, if empty use context tz, if empty use UTC cur_user = request.env['res.users'].browse(request.uid) - user_tz = timezone(cur_user.tz) + user_tz = utc + if cur_user.tz: + user_tz = timezone(cur_user.tz) + elif request.env.context['tz']: + user_tz = timezone(request.env.context['tz']) # Convert to UTC dt_utc = utc.localize(datetime, is_dst=False) # Convert to user TZ