-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
[FIX] shopfloor_base: Manage correctly parameters to the next call stack #845
[FIX] shopfloor_base: Manage correctly parameters to the next call stack #845
Conversation
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.
Code review + functional
Build fixed here: #849 |
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.
Can you rebase?
@@ -25,10 +32,25 @@ def _process_endpoint( | |||
collection = collection or request.env["shopfloor.app"].browse(app_id) | |||
# TODO: in base_rest `*args` is passed based on | |||
# the type of route (eg: /<int:id>/update) | |||
params = kwargs |
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.
would you mind adding the link to the change here?
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.
@simahawk In Odoo < 16, all the requests to a route defined on a RestController was wrapped into a HttpRestRequest by a patch of the Root.get_request
As side effect the json document was part of the kwargs passed to the _process_endpoint
method (https://github.com/OCA/rest-framework/blob/14.0/base_rest/http.py#L125) This behavior is changed into odoo > 16 by the registration of a dedicated dispatcher class to use for the routes declared with a routing type 'restapi' (https://github.com/OCA/rest-framework/blob/16.0/base_rest/http.py#L129). Since you bypass the dispatching made by base_rest and redefine your own handlers for the declared rest methods, the specific dispatcher is no more used. An other fix would be to register your handers with routing_type 'restapi'...
a03d987
to
2d946b7
Compare
This PR has the |
@rousseldenis Can you merge this one PLZ? |
@simahawk Is-it possible to merge this one plz? |
/ocabot merge patch |
What a great day to merge this nice PR. Let's do it! |
Congratulations, your PR was merged at 5f9e998. Thanks a lot for contributing to OCA. ❤️ |
@lmignon @simahawk