From 5e45dfbd13238cda3e7d4b42c96115979690cce6 Mon Sep 17 00:00:00 2001
From: Jean-Paul Smets <jp@nexedi.com>
Date: Tue, 4 May 2004 11:05:26 +0000
Subject: [PATCH] deepcopy required for acquisition propagate

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@818 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/CMFCategory/CategoryTool.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/product/CMFCategory/CategoryTool.py b/product/CMFCategory/CategoryTool.py
index d600ed3de3..52246f55aa 100755
--- a/product/CMFCategory/CategoryTool.py
+++ b/product/CMFCategory/CategoryTool.py
@@ -30,6 +30,7 @@
 ERP portal_categories tool.
 """
 
+from copy import deepcopy
 from OFS.Folder import Folder
 from Products.CMFCore.utils import UniqueObject
 from Globals import InitializeClass, DTMLFile
@@ -758,6 +759,7 @@ class CategoryTool( UniqueObject, Folder, Base ):
       else:
         context_base_key = (tuple(context.getPhysicalPath()), base_category)
         if context_base_key in acquired_object_dict:
+          acquired_object_dict = deepcopy(acquired_object_dict)
           type_dict = acquired_object_dict[context_base_key]
           if spec is ():
             if () in type_dict:
@@ -777,6 +779,7 @@ class CategoryTool( UniqueObject, Folder, Base ):
           else:
             for pt in spec:
               type_dict[pt] = 1
+          acquired_object_dict = deepcopy(acquired_object_dict)
           acquired_object_dict[context_base_key] = type_dict
                                 
       result = self.getSingleCategoryMembershipList( context, base_category, base=base,
@@ -798,7 +801,7 @@ class CategoryTool( UniqueObject, Folder, Base ):
             #if my_acquisition_object_path in acquired_object_dict:
             #  continue
             #acquired_object_dict[my_acquisition_object_path] = 1  
-            if spec is () or my_acquisition_object.portal_type in base_category_value.getAcquisitionPortalTypeList():
+            if my_acquisition_object.portal_type in base_category_value.getAcquisitionPortalTypeList():
               new_result = self.getSingleCategoryAcquiredMembershipList(my_acquisition_object,
                   base_category, spec=spec, filter=filter, portal_type=portal_type, base=base, acquired_object_dict=acquired_object_dict)
             else:
-- 
2.30.9