From 2f3f56d476e0d1fb498894f53b389ed50d9fbe3c Mon Sep 17 00:00:00 2001 From: Cesar Andres Sanchez Date: Tue, 12 Jul 2022 11:37:10 +0200 Subject: [PATCH] [IMP] base_external_system: black, isort, prettier --- base_external_system/models/external_system.py | 8 ++++++-- base_external_system/tests/test_external_system.py | 7 +++++-- .../base_external_system/odoo/addons/base_external_system | 1 + setup/base_external_system/setup.py | 6 ++++++ 4 files changed, 18 insertions(+), 4 deletions(-) create mode 120000 setup/base_external_system/odoo/addons/base_external_system create mode 100644 setup/base_external_system/setup.py diff --git a/base_external_system/models/external_system.py b/base_external_system/models/external_system.py index 7b7acd8a..d0a1b5e1 100644 --- a/base_external_system/models/external_system.py +++ b/base_external_system/models/external_system.py @@ -13,7 +13,8 @@ class ExternalSystem(models.Model): _description = "External System" name = fields.Char( - required=True, help="This is the canonical (humanized) name for the system.", + required=True, + help="This is the canonical (humanized) name for the system.", ) host = fields.Char( help="This is the domain or IP address that the system can be reached " "at.", @@ -56,7 +57,10 @@ class ExternalSystem(models.Model): default=lambda s: [(6, 0, s.env.user.company_id.ids)], help="Access to this system is restricted to these companies.", ) - system_type = fields.Selection(selection="_get_system_types", required=True,) + system_type = fields.Selection( + selection="_get_system_types", + required=True, + ) interface = fields.Reference( selection="_get_system_types", readonly=True, diff --git a/base_external_system/tests/test_external_system.py b/base_external_system/tests/test_external_system.py index ab264728..b1f212ba 100644 --- a/base_external_system/tests/test_external_system.py +++ b/base_external_system/tests/test_external_system.py @@ -43,12 +43,15 @@ class TestExternalSystem(Common): {"name": "Test", "system_type": "external.system.os"} ) self.assertEqual( - record.interface._name, "external.system.os", + record.interface._name, + "external.system.os", ) def test_create_context_override(self): """It should allow for interface create override with context.""" - model = self.env["external.system"].with_context(no_create_interface=True,) + model = self.env["external.system"].with_context( + no_create_interface=True, + ) record = model.create({"name": "Test", "system_type": "external.system.os"}) self.assertFalse(record.interface) diff --git a/setup/base_external_system/odoo/addons/base_external_system b/setup/base_external_system/odoo/addons/base_external_system new file mode 120000 index 00000000..6740d6a6 --- /dev/null +++ b/setup/base_external_system/odoo/addons/base_external_system @@ -0,0 +1 @@ +../../../../base_external_system \ No newline at end of file diff --git a/setup/base_external_system/setup.py b/setup/base_external_system/setup.py new file mode 100644 index 00000000..28c57bb6 --- /dev/null +++ b/setup/base_external_system/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)