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.

22 lines
697 B

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