From 253f0761437e8f5356511a3dd54c48a9da12a223 Mon Sep 17 00:00:00 2001 From: Ivan Office Date: Wed, 13 Nov 2024 22:57:40 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BC=9A=E8=AE=A1=E7=A7=91=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_cn_standard_latest/hooks.py | 19 +++++++++++++++---- l10n_cn_standard_latest/i18n/zh_CN.po | 2 +- .../models/template_cn_standard.py | 2 +- .../report/report_voucher.xml | 11 +++-------- .../views/account_account_views.xml | 2 +- 5 files changed, 21 insertions(+), 15 deletions(-) diff --git a/l10n_cn_standard_latest/hooks.py b/l10n_cn_standard_latest/hooks.py index cfa8c421..c61573fe 100644 --- a/l10n_cn_standard_latest/hooks.py +++ b/l10n_cn_standard_latest/hooks.py @@ -27,13 +27,24 @@ def pre_init_hook(env): def post_init_hook(env): """ 数据初始化,只在安装后执行,更新时不执行 - 此处不执行,只是记录,该数据已处理完成 + 注意 account.account 中 code 处理已不同,主要用 json 存在 code_store 中,故要不可使用 sql, + 同时 group_id 已为 compute 字段,无需设置 + """ # cr.execute("UPDATE account_account_template set group_id = " # "(select id from account_group where account_group.code_prefix_start=trim(substring(account_account_template.code from 1 for 1)) limit 1);") - env.cr.execute("UPDATE account_account set group_id = " - "(select id from account_group where account_group.code_prefix_start=trim(substring(account_account.code from 1 for 1)) limit 1);") - env.cr.commit() + # for g in [ + # env.ref('l10n_cn_standard_latest.account_group_1'), + # env.ref('l10n_cn_standard_latest.account_group_2'), + # env.ref('l10n_cn_standard_latest.account_group_3'), + # env.ref('l10n_cn_standard_latest.account_group_4'), + # env.ref('l10n_cn_standard_latest.account_group_5'), + # env.ref('l10n_cn_standard_latest.account_group_6'), + # ]: + # res = env['account.account'].search([('code', 'like', g.code_prefix_start + '%')]) + # if res: + # res.write({'group_id': g.id}) + # env.cr.commit() pass diff --git a/l10n_cn_standard_latest/i18n/zh_CN.po b/l10n_cn_standard_latest/i18n/zh_CN.po index 42c3aa98..bfe83887 100644 --- a/l10n_cn_standard_latest/i18n/zh_CN.po +++ b/l10n_cn_standard_latest/i18n/zh_CN.po @@ -29,7 +29,7 @@ msgstr "" #. odoo-python #: code:addons/l10n_cn_standard_latest/models/template_cn_standard.py:0 #, python-format -msgid "2024中国企业会计科目表-odoo17" +msgid "2025中国企业会计科目表-odoo18" msgstr "" #. module: l10n_cn_standard_latest diff --git a/l10n_cn_standard_latest/models/template_cn_standard.py b/l10n_cn_standard_latest/models/template_cn_standard.py index 7bb2e8b3..07fb773b 100644 --- a/l10n_cn_standard_latest/models/template_cn_standard.py +++ b/l10n_cn_standard_latest/models/template_cn_standard.py @@ -20,7 +20,7 @@ class AccountChartTemplate(models.AbstractModel): @template('cn_standard') def _get_cn_standard_template_data(self): return { - 'name': _('2024中国企业会计科目表-odoo17'), + 'name': _('2025中国企业会计科目表-odoo18'), 'code_digits': 4, 'property_account_receivable_id': 'account_1122', 'property_account_payable_id': 'account_2202', diff --git a/l10n_cn_standard_latest/report/report_voucher.xml b/l10n_cn_standard_latest/report/report_voucher.xml index be076dd7..eaea2047 100644 --- a/l10n_cn_standard_latest/report/report_voucher.xml +++ b/l10n_cn_standard_latest/report/report_voucher.xml @@ -2,13 +2,9 @@ @@ -16,7 +12,6 @@