Browse Source

[IMP] partner_affiliate: black, isort

14.0
Stephan Rozendaal 5 years ago
committed by Achraf Mhadhbi
parent
commit
fc0d2d9158
  1. 32
      partner_affiliate/__manifest__.py
  2. 10
      partner_affiliate/models/res_partner.py

32
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",
}

10
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)],
)
Loading…
Cancel
Save