diff --git a/openerp/osv/fields.py b/openerp/osv/fields.py index 040548ec7cc..ee0ea8fa23a 100644 --- a/openerp/osv/fields.py +++ b/openerp/osv/fields.py @@ -356,17 +356,16 @@ class datetime(_column): else: registry = openerp.modules.registry.RegistryManager.get(cr.dbname) tz_name = registry.get('res.users').read(cr, SUPERUSER_ID, uid, ['tz'])['tz'] + utc_timestamp = pytz.utc.localize(timestamp, is_dst=False) # UTC = no DST if tz_name: try: - utc = pytz.timezone('UTC') context_tz = pytz.timezone(tz_name) - utc_timestamp = utc.localize(timestamp, is_dst=False) # UTC = no DST return utc_timestamp.astimezone(context_tz) except Exception: _logger.debug("failed to compute context/client-specific timestamp, " "using the UTC value", exc_info=True) - return timestamp + return utc_timestamp class binary(_column): _type = 'binary'