From bdd33aef4a42964e1f6e62d5eee5a2ff2dacc98d Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Wed, 22 Nov 2006 12:42:14 +0000
Subject: [PATCH] make the manage_renameObject method working even if the
 activity tool is not installed

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11431 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/CopySupport.py | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/product/ERP5Type/CopySupport.py b/product/ERP5Type/CopySupport.py
index 5d265b3fad..60400702b8 100644
--- a/product/ERP5Type/CopySupport.py
+++ b/product/ERP5Type/CopySupport.py
@@ -127,9 +127,14 @@ class CopyContainer:
       """
       ob=self.restrictedTraverse(id)
       # Make sure there is no activities pending on that object
-      portal_activities = getToolByName(self, 'portal_activities')
-      if portal_activities.countMessage(path=ob.getPath())>0:
-        raise ValueError, 'Sorry, some message are pending'
+      try:
+        portal_activities = getToolByName(self, 'portal_activities')
+      except AttributeError:
+        # There is no activity tool
+        portal_activities = None
+      if portal_activities is not None:
+        if portal_activities.countMessage(path=ob.getPath())>0:
+          raise ValueError, 'Sorry, some message are pending'
 
       # Search for categories that have to be updated in sub objects.
       self._recursiveSetActivityAfterTag(ob)
-- 
2.30.9