From 2595ae9305483d9c586cef6ffa625c014d957a29 Mon Sep 17 00:00:00 2001 From: Julien Muchembled <jm@nexedi.com> Date: Fri, 13 Jun 2008 15:34:42 +0000 Subject: [PATCH] temp objects: * drop filter_content_types parameter of Folder.newContent * revert previous patch to ERP5/Document/Domain.py * add 'Domain Generator' to allowed content types of 'Base Domain' git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21596 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/Document/Domain.py | 6 ++---- .../allowed_content_types.xml | 1 + product/ERP5/bootstrap/erp5_core/bt/revision | 2 +- .../bt/template_portal_type_allowed_content_type_list | 1 + product/ERP5Type/Core/Folder.py | 5 ++--- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/product/ERP5/Document/Domain.py b/product/ERP5/Document/Domain.py index d126e3ca32..14943921a7 100644 --- a/product/ERP5/Document/Domain.py +++ b/product/ERP5/Document/Domain.py @@ -108,8 +108,7 @@ class Domain(Predicate, MetaNode, MetaResource): We need a way to know how deep we are in the domain generation to prevent infinite recursion XXX not implemented """ - klass = tmp_domain_generator = self.newContent( - portal_type='Domain Generator', temp_object=1, filter_content_types=0) + klass = tmp_domain_generator = self.newContent(portal_type='Domain Generator', temp_object=1) script = self.getDomainGeneratorMethodId('') return tmp_domain_generator.getDomainGeneratorList(depth=depth, klass=klass, script=script, parent=self) @@ -118,8 +117,7 @@ class Domain(Predicate, MetaNode, MetaResource): """ We generate temp domain here because we must set an aquisition wrapper """ - domain = self.newContent(id=id, portal_type='Domain', - temp_object=1, filter_content_types=0) + domain = self.newContent(id=id, portal_type='Domain', temp_object=1) return domain.__of__(self) def getChildDomainValueList(self, parent = None, **kw): diff --git a/product/ERP5/bootstrap/erp5_core/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml b/product/ERP5/bootstrap/erp5_core/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml index 8b8f7d46e6..a28f2ddf10 100644 --- a/product/ERP5/bootstrap/erp5_core/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml +++ b/product/ERP5/bootstrap/erp5_core/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml @@ -10,6 +10,7 @@ </portal_type> <portal_type id="Base Domain"> <item>Domain</item> + <item>Domain Generator</item> </portal_type> <portal_type id="Cache Factory"> <item>Ram Cache</item> diff --git a/product/ERP5/bootstrap/erp5_core/bt/revision b/product/ERP5/bootstrap/erp5_core/bt/revision index 6ae4142a6e..c5316a94dd 100644 --- a/product/ERP5/bootstrap/erp5_core/bt/revision +++ b/product/ERP5/bootstrap/erp5_core/bt/revision @@ -1 +1 @@ -847 \ No newline at end of file +848 \ No newline at end of file diff --git a/product/ERP5/bootstrap/erp5_core/bt/template_portal_type_allowed_content_type_list b/product/ERP5/bootstrap/erp5_core/bt/template_portal_type_allowed_content_type_list index b4efc045d8..cf57113892 100644 --- a/product/ERP5/bootstrap/erp5_core/bt/template_portal_type_allowed_content_type_list +++ b/product/ERP5/bootstrap/erp5_core/bt/template_portal_type_allowed_content_type_list @@ -2,6 +2,7 @@ Alarm Tool | Alarm Applied Rule | Simulation Movement Base Category | Category Base Domain | Domain +Base Domain | Domain Generator Cache Factory | Distributed Ram Cache Cache Factory | Ram Cache Cache Factory | SQL Cache diff --git a/product/ERP5Type/Core/Folder.py b/product/ERP5Type/Core/Folder.py index 93052022b7..d1dd3232ff 100644 --- a/product/ERP5Type/Core/Folder.py +++ b/product/ERP5Type/Core/Folder.py @@ -111,8 +111,7 @@ class FolderMixIn(ExtensionClass.Base): def newContent(self, id=None, portal_type=None, id_group=None, default=None, method=None, immediate_reindex=0, container=None, created_by_builder=0, activate_kw=None, - is_indexable=None, temp_object=0, reindex_kw=None, - filter_content_types=1, **kw): + is_indexable=None, temp_object=0, reindex_kw=None, **kw): """Creates a new content. This method is public, since TypeInformation.constructInstance will perform the security check. @@ -135,7 +134,7 @@ class FolderMixIn(ExtensionClass.Base): # XXX This feature is very confusing # And made the code more difficult to update portal_type = container.allowedContentTypes()[0].id - elif filter_content_types: + else: type_info = pt.getTypeInfo(container) if type_info is not None and not type_info.allowType(portal_type) and \ 'portal_trash' not in container.getPhysicalPath(): -- 2.30.9