-
Notifications
You must be signed in to change notification settings - Fork 60
[IMP] adapt code to new simplified safe_eval
API
#265
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
Open
KangOl
wants to merge
2
commits into
odoo:master
Choose a base branch
from
odoo-dev:master-safe-eval-refactor-globals-roan
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[IMP] adapt code to new simplified safe_eval
API
#265
KangOl
wants to merge
2
commits into
odoo:master
from
odoo-dev:master-safe-eval-refactor-globals-roan
+31
−14
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upgradeci retry with always only hr in all versions |
aj-fuentes
reviewed
Apr 23, 2025
aj-fuentes
reviewed
Apr 23, 2025
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.
LGTM. Minimal comment.
963dd2a
to
decb2d7
Compare
antonrom1
added a commit
to odoo-dev/odoo
that referenced
this pull request
Apr 24, 2025
This commit simplifies `safe_eval` which, up until now, allowed passing global and local namespaces. There is no usecase for this anymore. We want safe_eval exec mode to behave like a top-level module scope. `nocopy` is not needed anymore either. It's a relic of when the context could be dynamic (e.g. for already deleted `RecordDictWrapper` or `QWebContext`). Passed in context is always a dict. It will always be mutated with the local eval namespace dict after evaluation. This all makes `safe_eval` API less confusing. see enterprise: odoo/enterprise#83818 see upgrade-util: odoo/upgrade-util#265 task-4378806
antonrom1
added a commit
to odoo-dev/odoo
that referenced
this pull request
Apr 24, 2025
This commit simplifies `safe_eval` which, up until now, allowed passing global and local namespaces. There is no usecase for this anymore. We want safe_eval exec mode to behave like a top-level module scope. `nocopy` is not needed anymore either. It's a relic of when the context could be dynamic (e.g. for already deleted `RecordDictWrapper` or `QWebContext`). Passed in context is always a dict. It will always be mutated with the local eval namespace dict after evaluation. This all makes `safe_eval` API less confusing. See: odoo/enterprise#83818 See: odoo/upgrade-util#265 task-4378806
`safe_eval` loose the `nocopy` option. As we rely on it when evaluating expression, we need to reimplement `safe_eval` to do the evaluation using the `SelfPrintEvalContext`. See odoo/odoo#206846 See odoo/enterprise#83818
decb2d7
to
5b158c9
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
safe_eval
loose thenocopy
option. As we rely on it when evaluating expression, we need to reimplementsafe_eval
to do the evaluation using theSelfPrintEvalContext
.See odoo/odoo#206846
See odoo/enterprise#83818