From 0b53ea883c17bf6aba2850956fd457f7b73519b1 Mon Sep 17 00:00:00 2001 From: Arnaud Fontaine <arnaud.fontaine@nexedi.com> Date: Mon, 1 Nov 2010 05:17:24 +0000 Subject: [PATCH] CategoryProperty for ZODB Property Sheets is now a document git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39737 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5Type/Tool/PropertySheetTool.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/product/ERP5Type/Tool/PropertySheetTool.py b/product/ERP5Type/Tool/PropertySheetTool.py index 20406fef08..e6644f5f0c 100644 --- a/product/ERP5Type/Tool/PropertySheetTool.py +++ b/product/ERP5Type/Tool/PropertySheetTool.py @@ -97,16 +97,13 @@ class PropertySheetTool(BaseTool): for category in getattr(klass, '_categories', []): # A category may be a TALES Expression rather than a plain # string - if isinstance(category, Expression): - new_category = new_property_sheet.newContent( - portal_type='Dynamic Category Property') + portal_type = isinstance(category, Expression) and \ + 'Dynamic Category Property' or 'Category Property' - # Set the category TALES expression - new_category.importFromFilesystemDefinition(category) + new_category = new_property_sheet.newContent( + portal_type=portal_type) - else: - new_property_sheet.newContent(id=category, - portal_type='Category Property') + new_category.importFromFilesystemDefinition(category) return new_property_sheet -- 2.30.9