From ee5cd2e71eea721b2396a652f9ddd80915e73528 Mon Sep 17 00:00:00 2001 From: Harald Panten Date: Sat, 9 May 2020 18:20:20 +0200 Subject: [PATCH] [IMP] partner_contact_department: black, isort, prettier --- partner_contact_department/__init__.py | 2 +- partner_contact_department/__manifest__.py | 4 ++-- partner_contact_department/models/__init__.py | 2 +- partner_contact_department/models/res_partner.py | 10 ++-------- partner_contact_department/tests/__init__.py | 2 +- partner_contact_department/tests/test_recursion.py | 2 +- 6 files changed, 8 insertions(+), 14 deletions(-) diff --git a/partner_contact_department/__init__.py b/partner_contact_department/__init__.py index 83e553ac4..4b76c7b2d 100644 --- a/partner_contact_department/__init__.py +++ b/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 diff --git a/partner_contact_department/__manifest__.py b/partner_contact_department/__manifest__.py index 206e931da..7737a6f8c 100644 --- a/partner_contact_department/__manifest__.py +++ b/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, diff --git a/partner_contact_department/models/__init__.py b/partner_contact_department/models/__init__.py index ccebc7247..284a83ff1 100644 --- a/partner_contact_department/models/__init__.py +++ b/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 diff --git a/partner_contact_department/models/res_partner.py b/partner_contact_department/models/res_partner.py index 7053bb356..6ec252b26 100644 --- a/partner_contact_department/models/res_partner.py +++ b/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.")) diff --git a/partner_contact_department/tests/__init__.py b/partner_contact_department/tests/__init__.py index 1d19e3db4..eff500b85 100644 --- a/partner_contact_department/tests/__init__.py +++ b/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 diff --git a/partner_contact_department/tests/test_recursion.py b/partner_contact_department/tests/test_recursion.py index 925152cf0..5a56a5e40 100644 --- a/partner_contact_department/tests/test_recursion.py +++ b/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