[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:
parent
9bb7ff3413
commit
4a77c6a0c5
|
@ -22,6 +22,17 @@
|
||||||
""" OpenERP core library.
|
""" 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).
|
# The hard-coded super-user id (a.k.a. administrator, or root user).
|
||||||
SUPERUSER_ID = 1
|
SUPERUSER_ID = 1
|
||||||
|
|
||||||
|
|
|
@ -219,8 +219,6 @@ def quit_on_signals():
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
def main(args):
|
def main(args):
|
||||||
os.environ["TZ"] = "UTC"
|
|
||||||
|
|
||||||
check_root_user()
|
check_root_user()
|
||||||
openerp.tools.config.parse_config(args)
|
openerp.tools.config.parse_config(args)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue