Contributors mailing list archives

Browse archives


Keeping workflows

XCG Consulting, Houzéfa Abbasbhay
- 24/10/2017 11:22:25

As you probably know:
- Odoo 10 no longer uses any workflow in addons it provides, but the 
workflow system is still there should one want to use it.
- Workflows are gone in Odoo 11 (as mentioned on 

Over the years we have used workflows quite a bit with my colleagues and 
have found several interesting properties there that would be cumbersome 
to redo "by hand" (public methods / "write" override / whathaveyou) - 
see below for a (non exhaustive) pros & cons list.

I would like to know other people's ideas about this, and which 
alternatives you have in mind. Here are some I have thought of:
1) Mixin provided by an OCA addon
2) OCB support
3) Action rules (base_action_rule addon)

#1 is what I will inevitably end up doing to (at the very least) avoid 
some code duplication for the basic pros listed below. That could evolve 
into a whole workflow management system like the previous one if you 
experts believe this is the best alternative...

- Transitions: Check the previous state when flowing to the next one.
- Automatic transitions based on fields of the object.
- Security per transition.
- Independent workflow "branches" within the same workflow, sometimes 
linked to a sub-flow (eg "invoicing" & "stock management" branches in 
the sales order workflow).
- Multiple workflows per object.
- Workflow diagrams are easy to grasp by just looking at them - some 
details are of course hidden in the code but overall quite explicit.

- Old code, always a dreadful task to delve into.
- Multiple workflows per object: Ordering issues, especially when 
relying on auto-transitions as well (implementation issue; on paper the 
concept is appealing).
- Need scripts to apply a workflow onto lots of existing objects or to 
update states desynchronized with their workflow tracking elements 
(again, implementation issue that could be made easier).

I also want to mention workflow transitions are run in the same 
transaction as their trigger; not sure whether that is a pro or a con...

What do you think about keeping workflows?
Houzéfa Abbasbhay
XCG Consulting - Innovator