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

Module: Partner Mobile Duplicate Warn

Entity: res.partner

Compute Method: _compute_same_mobile_partner_ids

Inputs Method Outputs
  • mobile
  • company_id
  • company_id.id
for partner in self:
            same_mobile_partner_ids = False
            if partner.mobile:
                domain = [("mobile", "=", partner.mobile)]
                if partner.company_id:
                    domain += [
                        "|",
                        ("company_id", "=", False),
                        ("company_id", "=", partner.company_id.id),
                    ]
                partner_id = partner._origin.id
                if partner_id:
                    domain.append(("id", "!=", partner_id))
                same_mobile_partners = self.with_context(active_test=False).search(
                    domain
                )
                same_mobile_partner_ids = same_mobile_partners.ids or False
            partner.same_mobile_partner_ids = same_mobile_partner_ids

Back to entity