odoo/enterprise#80365
Created by SM Learn, Julien Castiaux (juc)
Merged
at ff6d7a5bd8921982969c9012778559db4e9ab4f1
Statuses:
- legal/cla: Contributor License Agreement check
- ci/runbot: Odoo Test Suite
- ci/upgrade_enterprise: Test upgrades for enterprise master
- ci/style: Optional style check. Ignore it only if strictly necessary.
- ci/security: Required security check. Can only be ignored by security team.
- ci/l10n: (runtime 0s)
Linked pull requests
- label
- odoo-dev:master-json2rpc-juc
- head
- 505cd44a5de7c5b8aa13f672bcca5740459cb398
- merged
- 4 months ago by SM Learn, Julien Castiaux (juc)
odoo/odoo | odoo/enterprise | |
---|---|---|
master | #197801 | #80365 |
[IMP] core: forward path arguments to readonly
The signature of collable
inside @route(readonly=callable)
was:
class ...(http.Controller):
def callable(self) -> bool:
...
It was possible to access the path, query-string and body via the globalish request
object:
request.httprequest.path
request.httprequest.args
request.httprequest.get_data()
But it was not possible up to this point to get the parameters extracted from the path.
Take for example the following endpoint:
@route('/endpoint/<word>', readonly=callable)
def endpoint(self, word):
....
The callable
function has no way to get word
unless we match the endpoint again.
With this PR we change the definition of those readonly callable once again, this time to include:
rule
: the endpoint that was matched along with itsrouting
dictionnary (the@route
extracted informations)args
: a dict containing the arguments extracted from the path.