add work item type 'checkup' with additional control on states and fields
This commit is contained in:
parent
6a443d549c
commit
34359f53d0
1 changed files with 12 additions and 3 deletions
|
@ -131,13 +131,16 @@ class WorkItemType(object):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, name, title, description=u'',
|
def __init__(self, name, title, description=u'',
|
||||||
actions=None, fields=None, indicator=None):
|
actions=None, fields=None, indicator=None,
|
||||||
|
delegatedState='delegated', prefillDate=True):
|
||||||
self.name = name
|
self.name = name
|
||||||
self.title = title
|
self.title = title
|
||||||
self.description = description
|
self.description = description
|
||||||
self.actions = actions or list(editingRules)
|
self.actions = actions or list(editingRules)
|
||||||
self.fields = fields or ('deadline', 'start-end', 'duration-effort')
|
self.fields = fields or ('deadline', 'start-end', 'duration-effort')
|
||||||
self.indicator = indicator
|
self.indicator = indicator
|
||||||
|
self.delegatedState = delegatedState
|
||||||
|
self.prefillDate = prefillDate
|
||||||
|
|
||||||
workItemTypes = Jeep((
|
workItemTypes = Jeep((
|
||||||
WorkItemType('work', u'Unit of Work', indicator='work_work'),
|
WorkItemType('work', u'Unit of Work', indicator='work_work'),
|
||||||
|
@ -150,7 +153,13 @@ workItemTypes = Jeep((
|
||||||
actions=('plan', 'accept', 'finish', 'cancel',
|
actions=('plan', 'accept', 'finish', 'cancel',
|
||||||
'modify', 'delegate', 'move', 'close', 'reopen'),
|
'modify', 'delegate', 'move', 'close', 'reopen'),
|
||||||
fields =('deadline',),
|
fields =('deadline',),
|
||||||
indicator='work_deadline')
|
indicator='work_deadline'),
|
||||||
|
WorkItemType('checkup', u'Check-up',
|
||||||
|
actions=('accept', 'finish', 'cancel',
|
||||||
|
'modify', 'delegate', 'close', 'reopen'),
|
||||||
|
fields =('deadline', 'start-end',),
|
||||||
|
indicator='work_checkup',
|
||||||
|
delegatedState='closed', prefillDate=False),
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
|
@ -259,7 +268,7 @@ class WorkItem(Stateful, Track):
|
||||||
xkw = dict(kw)
|
xkw = dict(kw)
|
||||||
xkw.pop('party', None)
|
xkw.pop('party', None)
|
||||||
delegated = self.createNew('delegate', userName, **xkw)
|
delegated = self.createNew('delegate', userName, **xkw)
|
||||||
delegated.state = 'delegated'
|
delegated.state = self.getWorkItemType().delegatedState
|
||||||
delegated.reindex('state')
|
delegated.reindex('state')
|
||||||
new = delegated.createNew('plan', userName, runId=0, **kw)
|
new = delegated.createNew('plan', userName, runId=0, **kw)
|
||||||
new.data['source'] = delegated.name
|
new.data['source'] = delegated.name
|
||||||
|
|
Loading…
Add table
Reference in a new issue