diff --git a/partner_affiliate/__manifest__.py b/partner_affiliate/__manifest__.py index b03a70ca9..5c1bc9136 100644 --- a/partner_affiliate/__manifest__.py +++ b/partner_affiliate/__manifest__.py @@ -3,22 +3,18 @@ # Copyright 2018 brain-tec AG - Raul Martin # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { - 'name': 'Partner Affiliates', - 'version': '12.0.1.0.0', - 'author': "Camptocamp, " - "Tecnativa, " - "brain-tec AG, " - "Onestein, " - "Odoo Community Association (OCA)", - 'website': 'https://github.com/OCA/partner-contact', - 'category': 'Customer Relationship Management', - 'license': 'AGPL-3', - 'installable': True, - 'depends': [ - 'base', - ], - 'data': [ - 'views/res_partner_view.xml', - ], - 'development_status': 'Production/Stable', + "name": "Partner Affiliates", + "version": "12.0.1.0.0", + "author": "Camptocamp, " + "Tecnativa, " + "brain-tec AG, " + "Onestein, " + "Odoo Community Association (OCA)", + "website": "https://github.com/OCA/partner-contact", + "category": "Customer Relationship Management", + "license": "AGPL-3", + "installable": True, + "depends": ["base"], + "data": ["views/res_partner_view.xml"], + "development_status": "Production/Stable", } diff --git a/partner_affiliate/models/res_partner.py b/partner_affiliate/models/res_partner.py index 6fe47322e..38ed4c739 100644 --- a/partner_affiliate/models/res_partner.py +++ b/partner_affiliate/models/res_partner.py @@ -7,16 +7,18 @@ from odoo import fields, models class ResPartner(models.Model): """Add relation affiliate_ids.""" + _inherit = "res.partner" # force "active_test" domain to bypass _search() override child_ids = fields.One2many( - domain=[('active', '=', True), ('is_company', '=', False)] + domain=[("active", "=", True), ("is_company", "=", False)] ) # force "active_test" domain to bypass _search() override affiliate_ids = fields.One2many( - 'res.partner', 'parent_id', - string='Affiliates', - domain=[('active', '=', True), ('is_company', '=', True)] + "res.partner", + "parent_id", + string="Affiliates", + domain=[("active", "=", True), ("is_company", "=", True)], )