[Erp5-report] r43541 seb - /erp5/trunk/products/ERP5Type/mixin/id_as_reference.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Feb 22 05:58:30 CET 2011


Author: seb
Date: Tue Feb 22 05:58:29 2011
New Revision: 43541

URL: http://svn.erp5.org?rev=43541&view=rev
Log:
postpone migration if there is pending activities, the migration
will be tried again later. This fix errors when updatint business
templates on existing instances

Modified:
    erp5/trunk/products/ERP5Type/mixin/id_as_reference.py

Modified: erp5/trunk/products/ERP5Type/mixin/id_as_reference.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/mixin/id_as_reference.py?rev=43541&r1=43540&r2=43541&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/mixin/id_as_reference.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/mixin/id_as_reference.py [utf8] Tue Feb 22 05:58:29 2011
@@ -29,6 +29,7 @@
 import transaction
 from AccessControl import ClassSecurityInfo
 from Products.ERP5Type import Permissions, PropertySheet
+from Products.CMFActivity.Errors import ActivityPendingError
 from zLOG import LOG, WARNING
 
 def IdAsReferenceMixin(suffix):
@@ -50,8 +51,14 @@ def IdAsReferenceMixin(suffix):
           LOG("IdAsReferenceMixin", WARNING, "Skipping migration of %r in %r"
               " property sheet, due to ID conflict" % (new_id, parent.getId()))
         else:
-          del self.default_reference
-          self.setId(new_id)
+          try:
+            self.setId(new_id)
+            del self.default_reference
+          except ActivityPendingError:
+            LOG("IdAsReferenceMixin", WARNING, "Skipping migration of %r in %r"
+              " property sheet, due to pending activities" % 
+               (new_id, parent.getId()))
+            
 
     security.declareProtected(Permissions.AccessContentsInformation,
                               'getReference')



More information about the Erp5-report mailing list