[FIX] timezone: under windows os.environ["TZ"] was not affecting the server,

now it does (probably because we make sure to first set the environment
*then* import the time module. Works fine under Windows XP.

lp bug: https://launchpad.net/bugs/1038017 fixed

bzr revid: vmt@openerp.com-20130307121637-47fac72clykizlnj
This commit is contained in:
Vo Minh Thu 2013-03-07 13:16:37 +01:00
parent 9bb7ff3413
commit 4a77c6a0c5
2 changed files with 11 additions and 2 deletions

View File

@ -22,6 +22,17 @@
""" OpenERP core library.
"""
# Make sure the OpenERP server runs in UTC. This is especially necessary
# under Windows as under Linux it seems the real import of time is
# sufficiently deferred so that setting the TZ environment variable
# in openerp.cli.server was working.
import os
os.environ['TZ'] = 'UTC' # Set the timezone...
import time # ... *then* import time.
del os
del time
# The hard-coded super-user id (a.k.a. administrator, or root user).
SUPERUSER_ID = 1

View File

@ -219,8 +219,6 @@ def quit_on_signals():
sys.exit(0)
def main(args):
os.environ["TZ"] = "UTC"
check_root_user()
openerp.tools.config.parse_config(args)