This commit is contained in:
ivan deng
2021-03-31 23:21:26 +08:00
parent effa625cec
commit 6b8d15ce85
23 changed files with 1045 additions and 24 deletions

View File

@@ -33,18 +33,18 @@ def post_init_hook(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
ids = env['product.category'].sudo().with_context(lang='zh_CN').search([
('parent_id', '!=', False)
], order='complete_name')
], order='parent_path')
for rec in ids:
rec._compute_complete_name()
ids = env['stock.location'].sudo().with_context(lang='zh_CN').search([
('location_id', '!=', False),
('usage', '!=', 'views'),
], order='complete_name')
], order='parent_path')
for rec in ids:
rec._compute_complete_name()
# 超级用户改时区为中国
ids = env['res.users'].sudo().with_context(lang='zh_CN').browse([1, 2])
ids.write({'tz': "Asia/Shanghai"})
ids.write({'tz': "Etc/GMT-8"})
except Exception as e:
raise Warning(e)
@@ -52,4 +52,4 @@ def uninstall_hook(cr, registry):
"""
数据初始化,卸载时执行
"""
pass
pass