Commit f603da7a authored by Jérome Perrin's avatar Jérome Perrin

check edit_action transition is available before passing the transition

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@8093 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 844aa00f
...@@ -74,10 +74,12 @@ from ZODB.POSException import ConflictError\n ...@@ -74,10 +74,12 @@ from ZODB.POSException import ConflictError\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
N_ = portal.Base_translateString\n N_ = portal.Base_translateString\n
\n \n
selected_uids = context.portal_selections.updateSelectionCheckedUidList(selection_name,listbox_uid,uids)\n selected_uids = portal.portal_selections.updateSelectionCheckedUidList(\n
uids = context.portal_selections.getSelectionCheckedUidsFor(selection_name)\n selection_name,listbox_uid,uids)\n
uids = portal.portal_selections.getSelectionCheckedUidsFor(selection_name)\n
\n \n
error = context.portal_selections.selectionHasChanged(md5_object_uid_list,uids)\n error = context.portal_selections.selectionHasChanged(md5_object_uid_list,\n
uids)\n
\n \n
REQUEST=context.REQUEST\n REQUEST=context.REQUEST\n
qs = \'\'\n qs = \'\'\n
...@@ -118,10 +120,13 @@ elif uids is not None:\n ...@@ -118,10 +120,13 @@ elif uids is not None:\n
qs = \'?portal_status_message=%s\' % message \n qs = \'?portal_status_message=%s\' % message \n
else:\n else:\n
try : \n try : \n
object_ids = \', \'.join([ x.getObject().getId() for x in context.portal_catalog(uid=uids)])\n object_ids = \', \'.join([x.getObject().getId()\n
for x in context.portal_catalog(uid=uids)])\n
context.manage_delObjects(uids=uids, REQUEST=REQUEST)\n context.manage_delObjects(uids=uids, REQUEST=REQUEST)\n
comment = N_(\'Deleted objects: ${object_ids}\',\n comment = N_(\'Deleted objects: ${object_ids}\',\n
mapping={\'object_ids\': object_ids})\n mapping={\'object_ids\': object_ids})\n
if \'edit_action\' in [x.get(\'id\', \'\') for x in\n
context.portal_workflow.getActionsFor(context)] :\n
# record object deletion in workflow history\n # record object deletion in workflow history\n
context.getPortalObject().portal_workflow.doActionFor(\n context.getPortalObject().portal_workflow.doActionFor(\n
context,\n context,\n
......
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