From 2c3880e2ff1b94f8df3062e926e5de3e99ee6f4f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Wed, 22 Feb 2006 12:59:22 +0000
Subject: [PATCH] this is the good version of changeObjectClasses introducted
 in last commit (I commited a wrong one ...)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5777 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Extensions/CheckPortalTypes.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/product/ERP5/Extensions/CheckPortalTypes.py b/product/ERP5/Extensions/CheckPortalTypes.py
index 5199359ab0..a3b1eca94c 100755
--- a/product/ERP5/Extensions/CheckPortalTypes.py
+++ b/product/ERP5/Extensions/CheckPortalTypes.py
@@ -11,12 +11,12 @@ def fixProductNames(self, REQUEST=None):
         contentType.product = 'ERP5Type'
   return msg
 
-def changeObjectClass(self, container, object_id, new_class):
-  """Creates a copy of object_id inside container, changing its class to
+def changeObjectClass(self, object_id, new_class):
+  """Creates a copy of object_id inside self, changing its class to
   new_class"""
-  old_obj = container._getObj(object_id)
+  old_obj = self._getOb(object_id)
+  self.manage_delObjects([object_id])
   new_obj = new_class(object_id)
   new_obj.__dict__.update(old_obj.__dict__)
-  container._setObject(object_id, new_obj)
-  
+  self._setObject(object_id, new_obj)
   
-- 
2.30.9