Browse Source

[IMP] partner_contact_department: black, isort, prettier

14.0
Harald Panten 5 years ago
committed by newtratip
parent
commit
ee5cd2e71e
  1. 2
      partner_contact_department/__init__.py
  2. 4
      partner_contact_department/__manifest__.py
  3. 2
      partner_contact_department/models/__init__.py
  4. 10
      partner_contact_department/models/res_partner.py
  5. 2
      partner_contact_department/tests/__init__.py
  6. 2
      partner_contact_department/tests/test_recursion.py

2
partner_contact_department/__init__.py

@ -1,3 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import models

4
partner_contact_department/__manifest__.py

@ -1,14 +1,14 @@
# Copyright 2014-2015 Tecnativa S.L. - Jairo Llopis
# Copyright 2016 Tecnativa S.L. - Vicent Cubells
# Copyright 2017 Tecnativa S.L. - David Vidal
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Partner Contact Department",
"summary": "Assign contacts to departments",
"version": "13.0.1.0.0",
"category": "Customer Relationship Management",
"author": "Tecnativa, " "Odoo Community Association (OCA)",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/partner-contact",
"application": False,

2
partner_contact_department/models/__init__.py

@ -1,3 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import res_partner

10
partner_contact_department/models/res_partner.py

@ -1,9 +1,8 @@
# © 2014-2015 Tecnativa S.L. - Jairo Llopis
# © 2016 Tecnativa S.L. - Vicent Cubells
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
from odoo import fields, models
class ResPartner(models.Model):
@ -27,8 +26,3 @@ class ResPartnerDepartment(models.Model):
"res.partner.department", "parent_id", "Child departments"
)
parent_path = fields.Char(index=True)
@api.constrains("parent_id")
def _check_parent_id(self):
if not self._check_recursion():
raise ValidationError(_("Error! You cannot create recursive departments."))

2
partner_contact_department/tests/__init__.py

@ -1,3 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0).
from . import test_recursion

2
partner_contact_department/tests/test_recursion.py

@ -1,5 +1,5 @@
# © 2016 Tecnativa - Vicent Cubells
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0).
from odoo.exceptions import UserError
from odoo.tests import common

Loading…
Cancel
Save