- Timestamp:
- 4 Dec 2014, 18:11:12 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/workflow.py
r12097 r12145 22 22 from zope.component import getUtility 23 23 from hurry.workflow.workflow import Transition, WorkflowState, NullCondition 24 from hurry.workflow.interfaces import IWorkflowState, IWorkflowTransitionEvent 24 from hurry.workflow.interfaces import ( 25 IWorkflowState, IWorkflowTransitionEvent, InvalidTransitionError) 25 26 from waeup.ikoba.interfaces import ( 26 27 IObjectHistory, IIkobaWorkflowInfo, IIkobaUtils, … … 28 29 SUBMITTED, VERIFIED, REJECTED, EXPIRED) 29 30 from waeup.ikoba.interfaces import MessageFactory as _ 30 from waeup.ikoba.workflow import IkobaWorkflow, IkobaWorkflowInfo 31 from waeup.ikoba.workflow import ( 32 IkobaWorkflow, IkobaWorkflowInfo) 31 33 from waeup.ikoba.customers.interfaces import ( 32 34 ICustomer, ICustomersUtils, … … 238 240 239 241 @grok.subscribe(IContract, IWorkflowTransitionEvent) 240 def handle_ document_transition_event(obj, event):241 """Append message to contract history and log file andupdate242 def handle_contract_transition_event(obj, event): 243 """Append message to contract history and log file, also update 242 244 last_transition_date when transition happened. 243 """ 245 246 Undo the approval of contract and raise an exception if contract 247 does not meet the requirements for approval. 248 """ 249 if event.transition.destination == APPROVED: 250 if not obj.is_approvable: 251 # Undo transition and raise an exception. 252 IWorkflowState(obj).setState(event.transition.source) 253 raise InvalidTransitionError( 254 "Documents must be verified first.") 244 255 msg = event.transition.user_data['msg'] 245 256 history = IObjectHistory(obj)
Note: See TracChangeset for help on using the changeset viewer.