diff --git a/odoo/service/db.py b/odoo/service/db.py index 13ba7b7e735..df641cb2c50 100644 --- a/odoo/service/db.py +++ b/odoo/service/db.py @@ -10,6 +10,7 @@ import traceback from xml.etree import ElementTree as ET import zipfile +from pytz import country_timezones from functools import wraps from contextlib import closing from decorator import decorator @@ -71,6 +72,9 @@ def _initialize_db(id, db_name, demo, lang, user_password, login='admin', countr if country_code: country = env['res.country'].search([('code', 'ilike', country_code)])[0] env['res.company'].browse(1).write({'country_id': country_code and country.id, 'currency_id': country_code and country.currency_id.id}) + if len(country_timezones.get(country_code, [])) == 1: + users = env['res.users'].search([]) + users.write({'tz': country_timezones[country_code][0]}) if phone: env['res.company'].browse(1).write({'phone': phone}) if '@' in login: