diff --git a/app_base_chinese/__manifest__.py b/app_base_chinese/__manifest__.py index bf57a7f5..286309dc 100644 --- a/app_base_chinese/__manifest__.py +++ b/app_base_chinese/__manifest__.py @@ -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'], diff --git a/app_base_chinese/hooks.py b/app_base_chinese/hooks.py index 8dbe473b..d69174eb 100644 --- a/app_base_chinese/hooks.py +++ b/app_base_chinese/hooks.py @@ -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)