odoo/enterprise#83818

Created by Anton Romanova (roan)
Merged at 3dd4b84f5174f40f3f5e0389ccfb686cc055d725

Statuses:

label
odoo-dev:master-safe-eval-refactor-globals-roan
head
7bd01c6900e9ec31c637132b881eeef94e44b30b
merged
2 months ago by Security, Denis Ledoux (dle)
odoo/odoo odoo/enterprise odoo/upgrade-util
master #206846 #83818 #265

[IMP] safe_eval: simplify API

This PR 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 begave 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/odoo#206846
See: odoo/upgrade-util#265

task-4378806