Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Partner Relations

Entity: res.partner.relation

Compute Method: _compute_left_partner_id_domain

Inputs Method Outputs
"""Set domain based mainly on type_id restrictions."""
for this in self:
            domain = []
            if this.type_id:
                contact_type = this.type_id.left_partner_type
                if contact_type:
                    is_company = True if contact_type == "c" else False
                    domain.append(("is_company", "=", is_company))
                category_id = this.type_id.left_partner_category_id
                if category_id:
                    domain.append(("category_id", "=", category_id.id))
            this.left_partner_id_domain = domain

Back to entity