opt chinese

This commit is contained in:
ivan deng
2019-04-15 04:57:30 +08:00
parent 828ce01914
commit 897bf5b1b1
2 changed files with 9 additions and 12 deletions

View File

@@ -44,8 +44,7 @@
'pre_init_hook': 'pre_init_hook',
'post_init_hook': 'post_init_hook',
'depends': [
'base',
'product',
'stock',
'l10n_cn'
],
'images': ['static/description/banner.jpg'],

View File

@@ -29,15 +29,13 @@ def post_init_hook(cr, registry):
"""
try:
env = api.Environment(cr, SUPERUSER_ID, {})
# oname = env['product.category'].with_context(lang='zh_CN').browse(1).name
# if oname:
# env['product.category'].with_context(lang='zh_CN').browse(1).write({
# 'name': oname + 'sunpop.cn',
# })
# env['product.category'].with_context(lang='zh_CN').browse(1).write({
# 'name': oname,
# })
env['product.category'].with_context(lang='zh_CN').browse(1)._compute_complete_name()
pass
ids = env['product.category'].sudo().with_context(lang='zh_CN').search([
('parent_id', '=', False)
])
ids._compute_complete_name()
ids = env['stock.location'].sudo().with_context(lang='zh_CN').search([
('location_id', '=', False)
])
ids._compute_complete_name()
except Exception as e:
raise Warning(e)