You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
944 B

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2012 Camptocamp SA - Yannick Vaucher
  3. # Copyright 2018 brain-tec AG - Raul Martin
  4. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  5. from odoo import fields, models
  6. class ResPartner(models.Model):
  7. """Add relation affiliate_ids."""
  8. _inherit = "res.partner"
  9. # force "active_test" domain to bypass _search() override
  10. child_ids = fields.One2many('res.partner', 'parent_id',
  11. string='Contacts',
  12. domain=[('active', '=', True),
  13. ('is_company', '=', False)])
  14. # force "active_test" domain to bypass _search() override
  15. affiliate_ids = fields.One2many('res.partner', 'parent_id',
  16. string='Affiliates',
  17. domain=[('active', '=', True),
  18. ('is_company', '=', True)])