Commit 7e1d96fe authored by Nicolas Delaby's avatar Nicolas Delaby

Fix behaviour of acquisition_mask_value argument in Accessors.

Policy is return non null local_value even if acquisition lookups fails
when acquisition_mask_value is False.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41762 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a9a99ab7
......@@ -1111,6 +1111,7 @@ class Base( CopyContainer,
value = getattr(self, storage_id, None)
else:
value = None
local_value = value
# If we hold an attribute and mask_value is set, return the attribute
if mask_value and value not in null_value:
# Pop context
......@@ -1216,6 +1217,11 @@ class Base( CopyContainer,
result = None
if result not in null_value:
return result
elif local_value not in null_value:
# Nothing has been found by looking up
# through acquisition documents, fallback by returning
# at least local_value
return local_value
else:
#LOG("alt_accessor_id",0,str(alt_accessor_id))
if alt_accessor_id is not None:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment