diff --git a/product/ERP5Type/ZopePatch.py b/product/ERP5Type/ZopePatch.py index 646e6e696ee760d75b7c253a7ed71d9bc042d56f..8bd8456e8c1d7cd2d9b711919fd948775851a1bc 100644 --- a/product/ERP5Type/ZopePatch.py +++ b/product/ERP5Type/ZopePatch.py @@ -42,6 +42,7 @@ from Products.ERP5Type.patches import CookieCrumbler from Products.ERP5Type.patches import Localizer from Products.ERP5Type.patches import CMFMailIn from Products.ERP5Type.patches import CMFCoreUtils +from Products.ERP5Type.patches import PropertySheets # These symbols are required for backward compatibility from Products.ERP5Type.patches.PropertyManager import ERP5PropertyManager diff --git a/product/ERP5Type/patches/PropertySheets.py b/product/ERP5Type/patches/PropertySheets.py new file mode 100644 index 0000000000000000000000000000000000000000..2784adf2849a2f7481f9f5115de23080cc7273e9 --- /dev/null +++ b/product/ERP5Type/patches/PropertySheets.py @@ -0,0 +1,28 @@ +############################################################################## +# +# Copyright (c) 2001, 2002 Zope Corporation and Contributors. +# Copyright (c) 2002,2005 Nexedi SARL and Contributors. All Rights Reserved. +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE +# +############################################################################## + +from OFS.PropertySheets import DAVProperties, isDavCollection +from Acquisition import aq_base + +# This is required to make an ERP5 Document (folderish) look like a file (non folderish) +def DAVProperties_dav__resourcetype(self): + vself = self.v_self() + if getattr(vself, 'isDocument', None): return '' # This is the patch + if (isDavCollection(vself) or + getattr(aq_base(vself), 'isAnObjectManager', None)): + return '<n:collection/>' + return '' + +DAVProperties.dav__resourcetype = DAVProperties_dav__resourcetype \ No newline at end of file