Commit b1e92e1b authored by Arnaud Fontaine's avatar Arnaud Fontaine

List Document Components as well as filesystem Document in Portal Type view.

parent 86c84618
......@@ -204,7 +204,15 @@ class TypesTool(TypeProvider):
Return a list of Document types that can be used as Base classes
"""
from Products.ERP5Type import document_class_registry
return sorted(document_class_registry)
document_type_set = set(document_class_registry)
# XXX-arnau: should be cached and reference?
component_tool = self.getPortalObject().portal_components
for obj in component_tool.searchFolder(portal_type='Document Component',
validation_state='validated'):
document_type_set.add(obj.getReference())
return sorted(document_type_set)
security.declareProtected(Permissions.AccessContentsInformation, 'getPortalTypeClass')
def getPortalTypeClass(self, context, temp=False):
......
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