Trying substate transitions work in workflows
To have substates, we want to implement transitions by clicking on buttons, and we expect the transition of the substate to behave as Workflow.transition() does with states.
- In a model we implement the fields “state” and “sub_state” defined as “fields.Selection” fields.
- We create buttons for each of the options in each “state” and “sub_state” field.
- Whit workflow.transition() in buttons, changes the state of the “state” field, but the “sub_state” field does not change the state.
- Making the “sub_state” field behave the same as “state”.
- According to the rule of model.workflow.transition, a default field called “state” is required, which we already see functional.
- OS: Ubuntu 20.04.1 LTS
- Python: 3.8.5
- Trytond: 5.8.1
- Tryton: 5.8.1
- Module: 5.8
- Postgresql: 12.5
- How to correctly implement the transition of the sub-state within each state? we are doing well by using model.workflow.transition() ?
- Is there a better method to achieve our purpose?
- An example code is also welcome.
We appreciate your guidance.