mark finished work items as 'finished_x' when moved so that one can decide later what to do with these
This commit is contained in:
		
							parent
							
								
									b0a01bae1a
								
							
						
					
					
						commit
						ab607a3b38
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		|  | @ -80,6 +80,7 @@ def workItemStates(): | |||
|         State('planned_x', 'planned', (), color='red'), | ||||
|         State('accepted_x', 'accepted', (), color='yellow'), | ||||
|         State('done_x', 'done', (), color='lightgreen'), | ||||
|         State('finished_x', 'finished', (), color='green'), | ||||
|         # transitions: | ||||
|         Transition('plan', 'plan', 'planned'), | ||||
|         Transition('accept', 'accept', 'accepted'), | ||||
|  | @ -174,6 +175,7 @@ class WorkItem(Stateful, Track): | |||
|     typeName = 'WorkItem' | ||||
|     typeInterface = IWorkItem | ||||
|     statesDefinition = 'organize.workItemStates' | ||||
|     workItemType = 'work' | ||||
| 
 | ||||
|     initAttributes = set(['workItemType', 'party', 'title', 'description',  | ||||
|                           'deadline', 'start', 'end', | ||||
|  | @ -293,7 +295,8 @@ class WorkItem(Stateful, Track): | |||
|         new.state = self.state | ||||
|         new.reindex() | ||||
|         moved.data['target'] = new.name | ||||
|         if self.state in ('planned', 'accepted', 'delegated', 'moved', 'done'): | ||||
|         if self.state in ('planned', 'accepted', 'delegated', 'moved',  | ||||
|                           'done', 'finished'): | ||||
|             self.state = self.state + '_x' | ||||
|             self.reindex('state') | ||||
|         return new | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue