Skip to content

Commit

Permalink
[IMP]endpoint: black, isort, prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillemCForgeFlow committed Nov 7, 2024
1 parent 55b1f5c commit 125f46e
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 27 deletions.
4 changes: 1 addition & 3 deletions endpoint/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
8 changes: 1 addition & 7 deletions endpoint/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 1 addition & 4 deletions endpoint/migrations/14.0.1.1.0/pre-migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
5 changes: 1 addition & 4 deletions endpoint/models/endpoint_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 1 addition & 4 deletions endpoint/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
6 changes: 1 addition & 5 deletions endpoint/tests/test_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
1 change: 1 addition & 0 deletions setup/endpoint/odoo/addons/endpoint
6 changes: 6 additions & 0 deletions setup/endpoint/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

0 comments on commit 125f46e

Please sign in to comment.