Commit 2679d742 authored by Sebastien Robin's avatar Sebastien Robin

Patch proposed by Jean-Paul,

_getDefaultAcquiredProperty was not handling well 
getDefault[Property of type List] when there is not
an acquisition object id.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22309 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 529fef7f
......@@ -1096,7 +1096,22 @@ class Base( CopyContainer,
econtext = createExpressionContext(self)
return expression(econtext)
else:
return value
if is_list_type:
# We must provide the first element of the acquired list
if value in null_value:
result = None
else:
if isinstance(value, (list, tuple)):
if len(value) is 0:
result = None
else:
result = value[0]
else:
result = value
else:
# Value is a simple type
result = value
return result
#Look at acquisition object before call acquisition
if acquisition_object_id is not None:
......@@ -2523,7 +2538,7 @@ class Base( CopyContainer,
security.declareProtected(Permissions.View, '__call__')
security.declareProtected(Permissions.View, 'list')
def list(self,reset=0):
def list(self, reset=0):
"""
Returns the default list even if folder_contents is overridden.
"""
......
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