Design Issue in Reservation of Manufacturing Orders
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
New
|
Undecided
|
Unassigned |
Bug Description
Tested on current 7.0 as well as on trunk.
There is a design error in the reservation of moves when they are in state 'waiting'. Waiting moves are not considered in the reservation process, which is ok in most cases. But in case of MOs there is an issue. See my description below:
Assume the following:
1. prod "main" consists of "sub1" and "sub2" (BOM)
BOM of "main" consists of "3x sub1" and "1x sub2"
2. prod "sub1" has qty of 3
3. prod "sub2" has qty of 0
4. create a MO of prod "main" with qty 1 and confirm
=> reservation of "sub1" is set to state 'assigned'
=> reservation of "sub2" is set to state 'confirmed'
5. create amother MO of prod "main" with qty 1 and confirm
=> reservation of "sub1" is set to state 'assigned'
=> reservation of "sub2" is set to state 'confirmed'
6. Now update the qty of "sub2" to 2 and run scheduler
7. Both MOs get ready for production and can be produced
=> HERE IS THE ERROR: The real stock of "sub" is now -3 although no reservation has been forced!
The problem is that a MO creates 2 moves for each position:
1. Stock -> Stock (available)
2. Stock -> Production (waiting)
In the reservation process the first move is not considered since the source and destination locations are the same.
And the second move is also not considered since it is not in state 'done' or 'assigned'.