summaryrefslogtreecommitdiff
path: root/odoo
diff options
context:
space:
mode:
authorDavid Arnold <dar@xoe.solutions>2018-03-12 04:14:01 -0500
committerRaphael Collet <rco@odoo.com>2018-03-12 10:14:01 +0100
commit231cae2e7f72774c8dfc20f549e3c8dc3bcb4cf6 (patch)
treebc861d3a927ef96cc1e1a0eee6eb441034f2cd8e /odoo
parent3360c550ccc27137779ad3ad3d0463a6b3232736 (diff)
[FIX] fields: copy_cache with failed values onto sudo env (#23122)
Do not copy failed values, as they usually reveal access error that should not occur in the sudoed env. Closes #23121
Diffstat (limited to 'odoo')
-rw-r--r--odoo/fields.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/odoo/fields.py b/odoo/fields.py
index 16e5e881fab..d19778a0a6a 100644
--- a/odoo/fields.py
+++ b/odoo/fields.py
@@ -69,6 +69,10 @@ def copy_cache(records, env):
for record_id in record_ids:
if record_id in src_cache:
# copy the cached value as such
+ if isinstance(src_cache[record_id], FailedValue):
+ # But not if it's a FailedValue, which often is an access error
+ # because the other environment (eg. sudo()) is well expected to have access.
+ continue
value = dst_cache[record_id] = src_cache[record_id]
if field.relational and isinstance(value, tuple):
todo[field.comodel_name].update(value)