优化会计科目表相关

This commit is contained in:
Ivan Office
2024-12-12 23:46:59 +08:00
parent 92219416ac
commit fedad73946
19 changed files with 367 additions and 151 deletions

View File

@@ -20,14 +20,4 @@ from odoo import api, fields, models, exceptions, _
class AccountAccountTemplate(models.Model):
_inherit = ['account.account.template']
_parent_name = "parent_id"
_parent_store = True
_parent_order = 'code'
# _rec_name = 'complete_name'
# todo: 具体项目中可以parent_id 处理为 compute, inverse=xxx(直接用pass),与 code_digits
parent_id = fields.Many2one('account.account.template', 'Parent Chart', index=True, ondelete='cascade')
child_ids = fields.One2many('account.account.template', 'parent_id', 'Child Chart')
parent_path = fields.Char(index=True, unaccent=False)
# 相关方法处理移至 app_account_ztree