diff --git a/l10n_cn_standard_latest/__manifest__.py b/l10n_cn_standard_latest/__manifest__.py
index 6fe45cc8..b9495288 100644
--- a/l10n_cn_standard_latest/__manifest__.py
+++ b/l10n_cn_standard_latest/__manifest__.py
@@ -30,7 +30,8 @@
4. 更新税信息。
5. 增加树状结构,支持二级科目,可设置上级科目,配合 "app_web_superbar" 使用可轻易实现树状导航。
6. 使用金蝶的会计科目命名法对多级科目进行初始化。可自行调整为用友科目命名法
- 7. 注意,必须在没有业务数据,没有会计科目的初始环境。可以使用 "app_odoo_customize" 模块清除财务数据,重置会计科目。
+ 7. 增加中文数字和阿拉伯数字的转换(需安装cn2an库,pip3 install cn2an)
+ 8. 注意,必须在没有业务数据,没有会计科目的初始环境。可以使用 "app_odoo_customize" 模块清除财务数据,重置会计科目。
如果是多语种环境需要自行更改翻译,主要体现在3%,6%,13%增值税处理。
中国财务,中国会计,中国城市
@@ -56,9 +57,14 @@
'views/account_account_views.xml',
'views/account_views.xml',
'data/account_account_tag_data.xml',
+ 'report/account_report.xml',
+ 'report/report_voucher.xml',
],
'post_init_hook': 'post_init_hook',
'installable': True,
'application': True,
'auto_install': False,
+ 'external_dependencies': {
+ 'python': ['cn2an']
+ },
}
diff --git a/l10n_cn_standard_latest/models/__init__.py b/l10n_cn_standard_latest/models/__init__.py
index 791ba3cb..bd733064 100644
--- a/l10n_cn_standard_latest/models/__init__.py
+++ b/l10n_cn_standard_latest/models/__init__.py
@@ -5,6 +5,7 @@ from . import account_account
from . import account_tax_group
from . import account_journal
from . import res_currency
+from . import account_move
diff --git a/l10n_cn_standard_latest/models/account_move.py b/l10n_cn_standard_latest/models/account_move.py
new file mode 100644
index 00000000..2325d311
--- /dev/null
+++ b/l10n_cn_standard_latest/models/account_move.py
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+
+from odoo import api, fields, models, _
+from odoo.exceptions import ValidationError
+from odoo.osv import expression
+
+try:
+ from cn2an import an2cn
+except ImportError:
+ an2cn = None
+
+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')
+ payment_ids = self.line_ids.mapped('payment_id')
+ if statement_ids:
+ domains.append([('res_model', '=', 'account.bank.statement'), ('res_id', 'in', statement_ids.ids)])
+ if payment_ids:
+ domains.append([('res_model', '=', 'account.payment'), ('res_id', 'in', payment_ids.ids)])
+ return self.env['ir.attachment'].search_count(expression.OR(domains))
\ No newline at end of file
diff --git a/l10n_cn_standard_latest/report/account_report.xml b/l10n_cn_standard_latest/report/account_report.xml
new file mode 100644
index 00000000..140e68f9
--- /dev/null
+++ b/l10n_cn_standard_latest/report/account_report.xml
@@ -0,0 +1,16 @@
+
+
+
+ Accounting Voucher
+
+
+
+
+
+
+
+
+
+ Balance
+ Account
+ Debit
+ Credit
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Total:
+
+
+
+
+
+
+
+
+