From b1e92e1b13b63074286837ccaf44729c71824ff6 Mon Sep 17 00:00:00 2001 From: Arnaud Fontaine <arnaud.fontaine@nexedi.com> Date: Wed, 25 Jan 2012 10:30:55 +0900 Subject: [PATCH] List Document Components as well as filesystem Document in Portal Type view. --- product/ERP5Type/Tool/TypesTool.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/product/ERP5Type/Tool/TypesTool.py b/product/ERP5Type/Tool/TypesTool.py index bdae984ab9..63b32eeaa6 100644 --- a/product/ERP5Type/Tool/TypesTool.py +++ b/product/ERP5Type/Tool/TypesTool.py @@ -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): -- 2.30.9