-
-
Notifications
You must be signed in to change notification settings - Fork 6
[18.0] shopfloor_base: critical fixes #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This was breaking _unregister_controllers since we don't get tuples
but EndpointRule objects.
Prior to this change the call failed like
File /odoo/external-src/shopfloor-app/shopfloor_base/models/shopfloor_app.py, line 166, in _registered_endpoint_rule_keys
return [x[0] for x in self._registered_routes()]
~^^^
TypeError: 'EndpointRule' object is not subscriptable
* ensure manifest url is always the same * improve comparison on handler options
The app was not using at all the base_rest dispatcher for restapi route type. This is because by default endpoint.route.handler use only http or json
Provides fix for existing installations.
florentx
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG
| @@ -0,0 +1,32 @@ | |||
| # Copyright 2025 Camptocamp SA | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two identical migration files. This one is redundant, isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one is for whoever lands on 18.0.1.0.0 and one for who's already on 18..0.1.0.2. Although 1.0.3 should run as well in the 1st case, I prefer to keep it as is.
|
/ocabot merge nobump |
|
This PR looks fantastic, let's merge it! |
|
Congratulations, your PR was merged at 0b9f39e. Thanks a lot for contributing to OCA. ❤️ |
| registry = app._endpoint_registry | ||
| rules = list(registry.get_rules_by_group(app._route_group())) | ||
| for rule in rules: | ||
| rule.routing = dict(rule.routing, readonly=True, type="restapi") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| rule.routing = dict(rule.routing, readonly=True, type="restapi") | |
| rule.routing = dict(rule.routing, readonly=False, type="restapi") |
This wrong, of course! Dumb me! I'll fix it.
Several fixes to make it work properly on v18.
Most important fix is
shopfloor_base: fix routing registration
The app was not using at all the base_rest dispatcher for restapi route type.
This is because by defualt endpoint.route.handler use only http or json