Conversation
|
|
1229e40 to
c9ba24d
Compare
8794251 to
80b805c
Compare
|
I've just realized that the 2nd commit in this PR handles the same issue as @mmahrouss 's PR: #488 |
80b805c to
783a486
Compare
|
This PR must be adapted to odoo/odoo#240683, that moves |
752b720 to
0d7490c
Compare
|
@cammarosano Hi! I've been doing a few PRs recently on the IAP side which is basically all controllers, and definitely missing the environment access on request. Just wondering if this PR is still in the works? I checked out the branch locally and it's been working well for what I need for the past bit so it would be nice to have it merged with all the other cool features of alpha. Thanks again for all your work on this! :) |
|
We'll try to include this branch in the 1.3. @cammarosano can you rebase it on alpha? |
- add evaluation for odoo.http.request: - up to 15.2: WebRequest class - since 15.3: Request class - add env variable to Request class (15.3+ only, as it already exists as property before that) - add evaluation to (Request/WebRequest).env: Environment | None This allows for better type evaluation in controllers, which use odoo.http.request extensively.
0d7490c to
1a446f7
Compare
Done |
This PR adds some missing features related to controllers.
requestnow evaluates toRequestclassrequest.envnow evaluates toEnvironment | Nonerequest.env["res.partner"]evaluates to the modelNext steps:
In a Controller,
self.envstill does not work, asenvis a property (which simply returnsrequest.env), and properties are not resolved to their return types.Support for resolving property types is introduced by #511, which should then:
self.envin aControllerclassrequest.envbefore 15.3, in whichrequestis an instance ofWebRequest, which in turn hasenvas a property.