mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
Merge remote-tracking branch 'origin/18.0' into 18.0
This commit is contained in:
@@ -9,17 +9,17 @@
|
||||
|
||||
{
|
||||
'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',
|
||||
'live_test_url': 'https://demo.odooapp.cn',
|
||||
'license': 'LGPL-3',
|
||||
'sequence': 12,
|
||||
'summary': """
|
||||
'summary': """
|
||||
Multi level account chart. Chinese enhance. Focus on account chart.
|
||||
Add account chart group data. Account group, Chinese tax.
|
||||
Set chinese account report.
|
||||
Set chinese account report.
|
||||
""",
|
||||
'description': """
|
||||
最新中国化财务,主要针对标准会计科目表作了优化。
|
||||
|
||||
@@ -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);")
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -11,18 +11,18 @@ except ImportError:
|
||||
|
||||
class AccountMove(models.Model):
|
||||
_inherit = 'account.move'
|
||||
|
||||
|
||||
@api.model
|
||||
def check_cn2an(self):
|
||||
return an2cn
|
||||
|
||||
|
||||
@api.model
|
||||
def _convert_to_amount_in_word(self, number):
|
||||
"""Convert number to ``amount in words`` for Chinese financial usage."""
|
||||
if not self.check_cn2an():
|
||||
return None
|
||||
return an2cn(number, 'rmb')
|
||||
|
||||
|
||||
def _count_attachments(self):
|
||||
domains = [[('res_model', '=', 'account.move'), ('res_id', '=', self.id)]]
|
||||
statement_ids = self.line_ids.mapped('statement_id')
|
||||
|
||||
@@ -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.")
|
||||
|
||||
|
||||
25
l10n_cn_standard_latest/models/res_company.py
Normal file
25
l10n_cn_standard_latest/models/res_company.py
Normal 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)
|
||||
@@ -16,7 +16,7 @@ class AccountChartTemplate(models.AbstractModel):
|
||||
# 'account.reconcile.model',
|
||||
# 'account.fiscal.position',
|
||||
# )
|
||||
|
||||
|
||||
@template('cn_standard')
|
||||
def _get_cn_standard_template_data(self):
|
||||
return {
|
||||
@@ -57,7 +57,7 @@ class AccountChartTemplate(models.AbstractModel):
|
||||
'account_journal_early_pay_discount_loss_account_id': 'account_6603',
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@template('cn_standard', 'account.journal')
|
||||
def _get_cn_account_journal(self):
|
||||
return {
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user