diff --git a/organize/work.py b/organize/work.py index 39b8fb7..0fe6102 100644 --- a/organize/work.py +++ b/organize/work.py @@ -59,7 +59,7 @@ def workItemStates(): 'move', 'cancel', 'modify'), color='lightgreen'), State('finished', 'finished', ('plan', 'accept', 'start', 'work', 'finish', - 'move', 'modify', 'close'), + 'move', 'modify', 'close', 'cancel'), color='green'), State('cancelled', 'cancelled', ('plan', 'accept', 'start', 'work', 'move', 'modify', 'close'), @@ -244,6 +244,9 @@ class WorkItem(Stateful, Track): elif self.state in ('planned', 'accepted', 'done'): self.state = self.state + '_x' self.reindex('state') + elif self.state in ('finished',) and action == 'cancel': + self.state = self.state + '_x' + self.reindex('state') new.doTransition(action) new.reindex() return new