fix checkmodule

This commit is contained in:
ivan deng
2019-05-01 19:07:35 +08:00
parent 8692177b53
commit 07efe82c50
3 changed files with 12 additions and 4 deletions

View File

@@ -17,12 +17,14 @@
from odoo import api, SUPERUSER_ID, _
def pre_init_hook(cr):
"""
数据初始化,只在安装时执行,更新时不执行
"""
pass
def post_init_hook(cr, registry):
"""
数据初始化,只在安装后执行,更新时不执行
@@ -37,5 +39,10 @@ def post_init_hook(cr, registry):
('location_id', '=', False)
])
ids._compute_complete_name()
# 超级用户改时区为中国
ids = env['res.users'].sudo().with_context(lang='zh_CN').search([
('id', '=', 2)
])
ids.write({'tz': "Asia/Shanghai"})
except Exception as e:
raise Warning(e)