Commit 83752607 authored by Yusei Tahara's avatar Yusei Tahara

erp5_crm: A category may indicate multiple documents.

parent e7251ca7
portal = context.getPortalObject() portal = context.getPortalObject()
arrow = portal.portal_property_sheets.get("Arrow") arrow = portal.portal_property_sheets.get("Arrow")
value_list = [('', ''),] result = [('', ''),]
value_list_append = value_list.append result_append = result.append
# add current user # add current user
user = portal.ERP5Site_getAuthenticatedMemberPersonValue() user = portal.ERP5Site_getAuthenticatedMemberPersonValue()
if user is not None: if user is not None:
value_list_append((user.getTitle(), user.getRelativeUrl())) result_append((user.getTitle(), user.getRelativeUrl()))
for property_value in arrow.contentValues(): for property_value in arrow.contentValues():
value = context.getProperty("%s_value" %property_value.getReference(), None) value_list = context.getProperty("%s_value_list" %property_value.getReference(), None)
if value and value.getPortalType() in portal.getPortalNodeTypeList(): if value_list is not None:
value = (value.getTitle(), value.getRelativeUrl()) for value in value_list:
if value not in value_list: if value and value.getPortalType() in portal.getPortalNodeTypeList():
value_list_append(value) value = (value.getTitle(), value.getRelativeUrl())
if value not in value_list:
result_append(value)
value_list.sort(key=lambda x: x[0]) result.sort(key=lambda x: x[0])
return value_list return result
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