From 218c8bb1b249ca6e9984cacadef460f890095d62 Mon Sep 17 00:00:00 2001
From: Arnaud Fontaine <arnaud.fontaine@nexedi.com>
Date: Wed, 2 Feb 2011 13:49:48 +0000
Subject: [PATCH] Fix migration of BT Property Sheets on Zope 2.8

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42933 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Document/BusinessTemplate.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/product/ERP5/Document/BusinessTemplate.py b/product/ERP5/Document/BusinessTemplate.py
index dd0fa238f0..6556b36a62 100644
--- a/product/ERP5/Document/BusinessTemplate.py
+++ b/product/ERP5/Document/BusinessTemplate.py
@@ -3623,12 +3623,13 @@ class PropertySheetTemplateItem(DocumentTemplateItem,
     # Migrate all the filesystem Property Sheets of the Business
     # Template if any
     property_sheet_tool = context.getPortalObject().portal_property_sheets
+    property_sheet_id_set = set(property_sheet_tool.objectIds())
 
     for class_id in migrate_object_dict:
       # If the Property Sheet already exists in ZODB, then skip it,
       # otherwise it should not be needed anymore once the deletion
       # code of the filesystem Property Sheets is enabled
-      if class_id in property_sheet_tool:
+      if class_id in property_sheet_id_set:
         raise RuntimeError('Conflict when migrating Property Sheet %s: ' \
                            'already exists in portal_property_sheets' % \
                            class_id)
-- 
2.30.9