Merge remote-tracking branch 'origin/18.0' into 18.0

This commit is contained in:
Ivan Office
2025-01-17 18:37:57 +08:00
8 changed files with 38 additions and 17 deletions

View File

@@ -9,7 +9,7 @@
{
'name': '2025最新中国会计科目表.企业标准会计.Latest Chinese Accounting for odoo18',
'version': '18.0.24.12.13',
'version': '18.0.25.01.15',
'author': 'odooai.cn',
'category': 'Accounting/Localizations/Account Charts',
'website': 'https://www.odooai.cn',

View File

@@ -27,10 +27,10 @@ def pre_init_hook(env):
def post_init_hook(env):
"""
数据初始化,只在安装后执行,更新时不执行
注意 account.account 中 code 处理已不同,主要用 json 存在 code_store 中,故要不可使用 sql
同时 group_id 已为 compute 字段,无需设置
中国公司,会计科目表非本模块中国企业会计科目表时,重载
"""
env['res.company'].search(['|', ('country_id', '=', env.ref('base.cn')), ('country_id.code', '=', 'CN')]).app_set_to_odooai_cn()
# 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);")

View File

@@ -6,7 +6,4 @@ from . import account_tax_group
from . import account_journal
from . import res_currency
from . import account_move
from . import res_company

View File

@@ -6,4 +6,3 @@ class AccountTaxGroup(models.Model):
_inherit = 'account.tax.group'
active = fields.Boolean(default=True, help="Set active to false to hide the tax without removing it.")

View File

@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
import logging
from odoo import models, fields, api, _
_logger = logging.getLogger(__name__)
class ResCompany(models.Model):
_inherit = 'res.company'
def app_set_to_odooai_cn(self):
for rec in self:
if rec.country_id.code == 'CN' and rec.chart_template != 'cn_standard':
has_accounting_entries = rec.root_id._existing_accounting()
if not has_accounting_entries:
unaffected_earnings_type = "equity_unaffected"
account = self.env['account.account'].with_company(rec).search([
*self.env['account.account']._check_company_domain(rec),
('account_type', '=', unaffected_earnings_type),
], limit=1)
if account:
account.unlink()
rec.chart_template = 'cn_standard'
self.env['account.chart.template'].try_loading(rec.chart_template, company=rec)

View File

@@ -17,7 +17,7 @@
<div class="oe_row oe_spaced">
<div class="row">
<div class="oe_row">
<h3>Lastest update: v18.24.12.13</h3>
<h3>Lastest update: v18.25.01.15</h3>
<div class="row">
<img class="oe_demo oe_screenshot img img-fluid" src="banner.png">
</div>