From 567c66eb08d4cbb3cfc80547f75e53c0d1cd99b7 Mon Sep 17 00:00:00 2001 From: GuillemCForgeFlow Date: Thu, 7 Nov 2024 15:38:48 +0100 Subject: [PATCH] [IMP]endpoint: black, isort, prettier --- endpoint/__manifest__.py | 4 +--- endpoint/hooks.py | 8 +------- endpoint/migrations/14.0.1.1.0/pre-migrate.py | 5 +---- endpoint/models/endpoint_mixin.py | 5 +---- endpoint/tests/common.py | 5 +---- endpoint/tests/test_endpoint.py | 6 +----- .../migrations/14.0.2.0.0/pre-migrate.py | 2 +- setup/endpoint/odoo/addons/endpoint | 1 + setup/endpoint/setup.py | 6 ++++++ 9 files changed, 14 insertions(+), 28 deletions(-) create mode 120000 setup/endpoint/odoo/addons/endpoint create mode 100644 setup/endpoint/setup.py diff --git a/endpoint/__manifest__.py b/endpoint/__manifest__.py index d04d2a8a..629596a0 100644 --- a/endpoint/__manifest__.py +++ b/endpoint/__manifest__.py @@ -16,8 +16,6 @@ "security/ir_rule.xml", "views/endpoint_view.xml", ], - "demo": [ - "demo/endpoint_demo.xml", - ], + "demo": ["demo/endpoint_demo.xml",], "post_init_hook": "post_init_hook", } diff --git a/endpoint/hooks.py b/endpoint/hooks.py index 02343054..701101a3 100644 --- a/endpoint/hooks.py +++ b/endpoint/hooks.py @@ -54,13 +54,7 @@ def _init_server_action(env): } if tools.sql.column_exists(env.cr, "ir_act_server", "activity_user_type"): values["activity_user_type"] = "specific" - ids = query_insert( - env.cr, - "ir_act_server", - [ - values, - ], - ) + ids = query_insert(env.cr, "ir_act_server", [values,],) # Finally add an xmlid module, id_ = xid.split(".", 1) diff --git a/endpoint/migrations/14.0.1.1.0/pre-migrate.py b/endpoint/migrations/14.0.1.1.0/pre-migrate.py index 7e8d6672..8fb61166 100644 --- a/endpoint/migrations/14.0.1.1.0/pre-migrate.py +++ b/endpoint/migrations/14.0.1.1.0/pre-migrate.py @@ -14,10 +14,7 @@ def migrate(cr, version): env = api.Environment(cr, SUPERUSER_ID, {}) module = env["ir.module.module"].search( - [ - ("name", "=", "rpc_helper"), - ("state", "=", "uninstalled"), - ] + [("name", "=", "rpc_helper"), ("state", "=", "uninstalled"),] ) if module: _logger.info("Install module rpc_helper") diff --git a/endpoint/models/endpoint_mixin.py b/endpoint/models/endpoint_mixin.py index 22da0656..2b9a97c5 100644 --- a/endpoint/models/endpoint_mixin.py +++ b/endpoint/models/endpoint_mixin.py @@ -19,10 +19,7 @@ class EndpointMixin(models.AbstractModel): _inherit = "endpoint.route.handler" _description = "Endpoint mixin" - exec_mode = fields.Selection( - selection="_selection_exec_mode", - required=True, - ) + exec_mode = fields.Selection(selection="_selection_exec_mode", required=True,) code_snippet = fields.Text() code_snippet_docs = fields.Text( compute="_compute_code_snippet_docs", diff --git a/endpoint/tests/common.py b/endpoint/tests/common.py index 48c944cd..00567caa 100644 --- a/endpoint/tests/common.py +++ b/endpoint/tests/common.py @@ -24,10 +24,7 @@ def _setup_env(cls): @classmethod def _setup_context(cls): - return dict( - cls.env.context, - tracking_disable=True, - ) + return dict(cls.env.context, tracking_disable=True,) @classmethod def _setup_records(cls): diff --git a/endpoint/tests/test_endpoint.py b/endpoint/tests/test_endpoint.py index e59f3b73..48db35dd 100644 --- a/endpoint/tests/test_endpoint.py +++ b/endpoint/tests/test_endpoint.py @@ -25,11 +25,7 @@ def _setup_records(cls): def test_endpoint_unique(self): with self.assertRaises(psycopg2.IntegrityError): self.env["endpoint.endpoint"].create( - { - "name": "Endpoint", - "route": "/demo/one", - "exec_mode": "code", - } + {"name": "Endpoint", "route": "/demo/one", "exec_mode": "code",} ) def test_endpoint_validation(self): diff --git a/endpoint_route_handler/migrations/14.0.2.0.0/pre-migrate.py b/endpoint_route_handler/migrations/14.0.2.0.0/pre-migrate.py index 40f781da..afe1f85e 100644 --- a/endpoint_route_handler/migrations/14.0.2.0.0/pre-migrate.py +++ b/endpoint_route_handler/migrations/14.0.2.0.0/pre-migrate.py @@ -5,7 +5,7 @@ # fmt: off from odoo.addons.endpoint_route_handler.registry import ( - EndpointRegistry # pylint: disable=odoo-addons-relative-import, + EndpointRegistry # pylint: disable=odoo-addons-relative-import,, ) # fmt: on diff --git a/setup/endpoint/odoo/addons/endpoint b/setup/endpoint/odoo/addons/endpoint new file mode 120000 index 00000000..2cda25b4 --- /dev/null +++ b/setup/endpoint/odoo/addons/endpoint @@ -0,0 +1 @@ +../../../../endpoint \ No newline at end of file diff --git a/setup/endpoint/setup.py b/setup/endpoint/setup.py new file mode 100644 index 00000000..28c57bb6 --- /dev/null +++ b/setup/endpoint/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)