Files
app-odoo/app_base_company_zchart/models/res_company.py
Ivan Office 57a545edc3 opt wl_base
2024-05-24 16:21:08 +08:00

20 lines
496 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='Child Companies', compute='_compute_all_child_ids')
@api.depends('parent_id', 'child_ids')
def _compute_all_child_ids(self):
pass