From 1095d342ee11aa678b05c9b849cedb68bb8168c3 Mon Sep 17 00:00:00 2001
From: Alexandre Boeglin <alex@nexedi.com>
Date: Thu, 26 Oct 2006 13:52:28 +0000
Subject: [PATCH] fix for older versions of BTreeFolder2 with no _initBTrees
 method

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10965 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/Document/Folder.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/product/ERP5Type/Document/Folder.py b/product/ERP5Type/Document/Folder.py
index b0a9788e5a..819e2ddb6e 100644
--- a/product/ERP5Type/Document/Folder.py
+++ b/product/ERP5Type/Document/Folder.py
@@ -819,7 +819,11 @@ be a problem)."""
     # when an object inherits from Folder after it was instanciated, it lacks
     # its BTreeFolder properties.
     if getattr(self, '_tree', None) is None:
-      self._initBTrees()
+      try:
+        self._initBTrees()
+      except AttributeError:
+        from Products.BTreeFolder2.BTreeFolder2 import BTreeFolder2Base
+        BTreeFolder2Base.__init__(self, self.getId())
     object_list = CMFBTreeFolder.objectValues(self, spec=spec)
     if portal_type is not None:
       if type(portal_type) == type(''):
-- 
2.30.9