diff --git a/fastapi/models/fastapi_endpoint.py b/fastapi/models/fastapi_endpoint.py index c55d7ebd6..f4508033b 100644 --- a/fastapi/models/fastapi_endpoint.py +++ b/fastapi/models/fastapi_endpoint.py @@ -65,6 +65,7 @@ class FastapiEndpoint(models.Model): "unexpecteed disk space consumption.", default=True, ) + route_group = fields.Char(help="Use this to classify routes together", size=32) @api.depends("root_path") def _compute_root_path(self): @@ -124,7 +125,7 @@ def _registered_endpoint_rule_keys(self): def _routing_impacting_fields(self) -> tuple[str, ...]: """The list of fields requiring to refresh the mount point of the pp into odoo if modified""" - return ("root_path", "save_http_session") + return ("root_path", "save_http_session", "route_group") # # end of endpoint.route.sync.mixin methods implementation @@ -161,7 +162,7 @@ def _make_routing_rule(self, options=None): key = self._endpoint_registry_route_unique_key(routing) endpoint_hash = hash(route) return self._endpoint_registry.make_rule( - key, route, options, routing, endpoint_hash + key, route, options, routing, endpoint_hash, route_group=self.route_group ) def _default_endpoint_options(self): diff --git a/fastapi/views/fastapi_endpoint.xml b/fastapi/views/fastapi_endpoint.xml index cd7ce166c..19df73918 100644 --- a/fastapi/views/fastapi_endpoint.xml +++ b/fastapi/views/fastapi_endpoint.xml @@ -42,6 +42,7 @@ +