Commit 8254f9e6 authored by Sebastien Robin's avatar Sebastien Robin

postpone migration if there is pending activities, the migration

will be tried again later. This fix errors when updatint business
templates on existing instances

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43541 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b37f93b2
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
import transaction import transaction
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet from Products.ERP5Type import Permissions, PropertySheet
from Products.CMFActivity.Errors import ActivityPendingError
from zLOG import LOG, WARNING from zLOG import LOG, WARNING
def IdAsReferenceMixin(suffix): def IdAsReferenceMixin(suffix):
...@@ -50,8 +51,14 @@ def IdAsReferenceMixin(suffix): ...@@ -50,8 +51,14 @@ def IdAsReferenceMixin(suffix):
LOG("IdAsReferenceMixin", WARNING, "Skipping migration of %r in %r" LOG("IdAsReferenceMixin", WARNING, "Skipping migration of %r in %r"
" property sheet, due to ID conflict" % (new_id, parent.getId())) " property sheet, due to ID conflict" % (new_id, parent.getId()))
else: else:
del self.default_reference try:
self.setId(new_id) 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, security.declareProtected(Permissions.AccessContentsInformation,
'getReference') 'getReference')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment