-
- Downloads
[FIX] fields.py: no lose _protected on related_sudo
If we are: - not in sudo - computing a compute field - using a related_sudo field we want to keep the env._protected dictionary when we `sudo` to get the related value, because if we don't we lost the protection of field we were currently computing. Original description: > When a "computed value A" relies on "computed value B" and > "computed value B" needs a related value (e.g. product.product from > product.template), then "_compute_related" in api.py will copy the > cache if the user is not superuser. > > The cache is not copying the values in "_protected", causing > "modified_draft" in fields.py to incorrectly invalidate the cache for > already computed values which should be protected by their inclusion > in "_protected". note: the added test does not fail without this change, it is just a partial backport of 12.0 to ensure what worked still worked. opw-2146097 closes #40916 closes #42714 closes odoo/odoo#43376 X-original-commit: 97bdb7a668b5c4c9ad759fc795e859207b6ed28d Signed-off-by:Nicolas Lempereur (nle) <nle@odoo.com> Co-authored-by:
Nicolas Lempereur <nle@odoo.com>
Loading
Please register or sign in to comment