Skip to content

[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
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

KangOl
Copy link
Contributor

@KangOl KangOl commented Apr 23, 2025

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

@robodoo
Copy link
Contributor

robodoo commented Apr 23, 2025

Pull request status dashboard

@KangOl
Copy link
Contributor Author

KangOl commented Apr 23, 2025

upgradeci retry with always only hr in all versions

@KangOl KangOl requested a review from aj-fuentes April 23, 2025 12:36
Copy link
Contributor

@aj-fuentes aj-fuentes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Minimal comment.

@KangOl KangOl force-pushed the master-safe-eval-refactor-globals-roan branch from 963dd2a to decb2d7 Compare April 24, 2025 12:03
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
@KangOl KangOl force-pushed the master-safe-eval-refactor-globals-roan branch from decb2d7 to 5b158c9 Compare April 24, 2025 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants