Files
app-odoo/app_base_company_zchart/models/res_company.py
2024-05-25 00:40:59 +08:00

20 lines
500 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# -*- coding: utf-8 -*-
from odoo import api, fields, models, tools, _
class Company(models.Model):
_inherit = "res.company"
_parent_store = True
parent_path = fields.Char(index=True, unaccent=False)
# 注意res.partner 有 parent_id 和 child_ids
all_child_ids = fields.One2many('res.company', string='All Child Companies', compute='_compute_all_child_ids')
@api.depends('parent_id', 'child_ids')
def _compute_all_child_ids(self):
pass