[Erp5-report] r26916 - /erp5/trunk/products/ERP5Type/Base.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue May 12 11:07:09 CEST 2009
Author: jm
Date: Tue May 12 11:07:06 2009
New Revision: 26916
URL: http://svn.erp5.org?rev=26916&view=rev
Log:
A workflow method should raise an exception when it is invoked from a workflow state which does not support it or whenever guards reject it. Add log for the moment.
Modified:
erp5/trunk/products/ERP5Type/Base.py
Modified: erp5/trunk/products/ERP5Type/Base.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Base.py?rev=26916&r1=26915&r2=26916&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Base.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/Base.py [utf8] Tue May 12 11:07:06 2009
@@ -199,8 +199,15 @@
valid_transition_item_list = []
for wf_id, transition_list in candidate_transition_item_list:
candidate_workflow = wf[wf_id]
- valid_list = [transition_id for transition_id in transition_list
- if candidate_workflow.isWorkflowMethodSupported(instance, transition_id)]
+ valid_list = []
+ for transition_id in transition_list:
+ if candidate_workflow.isWorkflowMethodSupported(instance, transition_id):
+ valid_list.append(transition_id)
+ else:
+ LOG("WorkflowMethod.__call__", ERROR,
+ "Transition %s/%s on %r is ignored. Current state is %r."
+ % (wf_id, transition_id, instance,
+ candidate_workflow._getWorkflowStateOf(instance, id_only=1)))
if valid_list:
valid_transition_item_list.append((wf_id, valid_list))
More information about the Erp5-report
mailing list