diff --git a/partner_company_group/__manifest__.py b/partner_company_group/__manifest__.py index bf724a737..0bc5c24f2 100644 --- a/partner_company_group/__manifest__.py +++ b/partner_company_group/__manifest__.py @@ -1,24 +1,19 @@ # Copyright 2019 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { - 'name': 'Partner Company Group', - 'summary': 'Adds the possibility to add a company group to a company', - 'version': '12.0.1.0.0', - 'category': 'Sales', - 'author': 'Camptocamp SA, Odoo Community Association (OCA)', - 'license': 'AGPL-3', - 'depends': [ - 'base', - 'account', - 'crm', - 'sale', + "name": "Partner Company Group", + "summary": "Adds the possibility to add a company group to a company", + "version": "12.0.1.0.0", + "category": "Sales", + "author": "Camptocamp SA, Odoo Community Association (OCA)", + "license": "AGPL-3", + "depends": ["base", "account", "crm", "sale"], + "website": "https://github.com/OCA/partner-contact", + "data": [ + "views/opportunity_view.xml", + "views/contact_view.xml", + "views/sale_order_view.xml", + "views/account_invoice_view.xml", ], - 'website': 'https://github.com/OCA/partner-contact', - 'data': [ - 'views/opportunity_view.xml', - 'views/contact_view.xml', - 'views/sale_order_view.xml', - 'views/account_invoice_view.xml', - ], - 'installable': True, + "installable": True, } diff --git a/partner_company_group/models/account_invoice.py b/partner_company_group/models/account_invoice.py index 1c17a8b81..a25dd0388 100644 --- a/partner_company_group/models/account_invoice.py +++ b/partner_company_group/models/account_invoice.py @@ -1,13 +1,12 @@ # Copyright 2019 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from odoo import models, fields +from odoo import fields, models class AccountInvoice(models.Model): - _inherit = 'account.invoice' + _inherit = "account.invoice" company_group_id = fields.Many2one( - related='partner_id.company_group_id', - store=True + related="partner_id.company_group_id", store=True ) diff --git a/partner_company_group/models/crm_lead.py b/partner_company_group/models/crm_lead.py index 8e62b5277..10b7d3ace 100644 --- a/partner_company_group/models/crm_lead.py +++ b/partner_company_group/models/crm_lead.py @@ -1,13 +1,12 @@ # Copyright 2019 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from odoo import models, fields +from odoo import fields, models class CrmLead(models.Model): - _inherit = 'crm.lead' + _inherit = "crm.lead" company_group_id = fields.Many2one( - related='partner_id.company_group_id', - store=True + related="partner_id.company_group_id", store=True ) diff --git a/partner_company_group/models/res_partner.py b/partner_company_group/models/res_partner.py index 6b9b75eb1..10c97350e 100644 --- a/partner_company_group/models/res_partner.py +++ b/partner_company_group/models/res_partner.py @@ -1,17 +1,15 @@ # Copyright 2019 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from odoo import models, fields +from odoo import fields, models class Contact(models.Model): - _inherit = 'res.partner' + _inherit = "res.partner" company_group_id = fields.Many2one( - 'res.partner', - 'Company group', - domain=[('is_company', '=', True)] + "res.partner", "Company group", domain=[("is_company", "=", True)] ) def _commercial_fields(self): - return super(Contact, self)._commercial_fields() + ['company_group_id'] + return super(Contact, self)._commercial_fields() + ["company_group_id"] diff --git a/partner_company_group/models/sale_order.py b/partner_company_group/models/sale_order.py index 8549b4cdc..46e5386a4 100644 --- a/partner_company_group/models/sale_order.py +++ b/partner_company_group/models/sale_order.py @@ -1,13 +1,12 @@ # Copyright 2019 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from odoo import models, fields +from odoo import fields, models class SaleOrder(models.Model): - _inherit = 'sale.order' + _inherit = "sale.order" company_group_id = fields.Many2one( - related='partner_id.company_group_id', - store=True + related="partner_id.company_group_id", store=True )