Files
tryton/trytond/test/workflow.py
T
Cédric Krier be0e5c54a9 Simplify workflow engine
- Remove workflow module
- Add ir.model.button for access rights

review256001
2012-03-25 00:15:17 +01:00

30 lines
736 B
Python

# This file is part of Tryton. The COPYRIGHT file at the top level of this
# repository contains the full copyright notices and license terms.
from trytond.model import ModelSQL, Workflow, fields
class WorkflowedModel(Workflow, ModelSQL):
_name = 'test.workflowed'
state = fields.Selection([
('start', 'Start'),
('running', 'Running'),
('end', 'End'),
], 'State')
def __init__(self):
super(WorkflowedModel, self).__init__()
self._transitions |= set((
('start', 'running'),
))
def default_state(self):
return 'start'
@Workflow.transition('running')
def run(self, ids):
pass
WorkflowedModel()