Changeset 12168 for main/waeup.ikoba/trunk/src/waeup
- Timestamp:
- 8 Dec 2014, 06:17:30 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/contracts.py
r12167 r12168 143 143 state = getattr(obj, 'state', None) 144 144 if state and state != VERIFIED: 145 return False 146 return True 145 return False, _("Attached documents must be verified first.") 146 return True, None 147 147 148 148 @property -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/documents.py
r12166 r12168 141 141 return files 142 142 143 @property 144 def is_verifiable(self): 145 return True, None 146 143 147 def setMD5(self): 144 148 """Set md5 checksum attribute for files connected to this document. -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/export.py
r12167 r12168 159 159 omit=['is_editable_by_customer', 160 160 'is_editable_by_manager', 161 'is_verifiable', 161 162 'translated_state', 162 163 'formatted_transition_date', -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/workflow.py
r12151 r12168 248 248 """ 249 249 if event.transition.destination == APPROVED: 250 if not obj.is_approvable: 250 approvable, error = obj.is_approvable 251 if not approvable: 251 252 # Undo transition and raise an exception. 252 253 IWorkflowState(obj).setState(event.transition.source) 253 raise InvalidTransitionError( 254 _("Attached documents must be verified first.")) 254 raise InvalidTransitionError(error) 255 255 msg = event.transition.user_data['msg'] 256 256 history = IObjectHistory(obj) -
main/waeup.ikoba/trunk/src/waeup/ikoba/documents/document.py
r12161 r12168 87 87 return 88 88 89 @property 90 def is_verifiable(self): 91 return True, None 92 89 93 def setMD5(self): 90 94 """Determine md5 checksum of all files and store checksums as -
main/waeup.ikoba/trunk/src/waeup/ikoba/documents/interfaces.py
r12161 r12168 53 53 user_id = Attribute('Id of a user') 54 54 connected_files = Attribute('Names of files connected to a document') 55 is_verifiable = Attribute('Contract verifiable by officer') 55 56 56 57 title = schema.TextLine( -
main/waeup.ikoba/trunk/src/waeup/ikoba/documents/workflow.py
r12162 r12168 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, … … 128 129 """Append message to document history and log file and update 129 130 last_transition_date when transition happened. 131 132 Undo the verification of document and raise an exception if document 133 does not meet the requirements for verification. 130 134 """ 135 if event.transition.destination == VERIFIED: 136 verifiable, error = obj.is_verifiable 137 if not verifiable: 138 # Undo transition and raise an exception. 139 IWorkflowState(obj).setState(event.transition.source) 140 raise InvalidTransitionError(error) 131 141 if event.transition.transition_id == 'verify': 132 142 obj.setMD5()
Note: See TracChangeset for help on using the changeset viewer.