Comment 0 for bug 532148

Revision history for this message
Don Kirkby (donkirkby) wrote :

I am testing with the 5.0 branch of openobject-addons revision 2582.
I will attach a merge proposal with a failing unit test, but here are the steps to reproduce the problem using the demo data:
- Create a procurement for 3 units of MB1.
- Confirm the procurement.
- Run the procurement.
- Open the purchase order that it generated.
- Confirm the purchase order.
- Approve the purchase order.
- Open the incoming shipment that it generated.
- Receive the shipment.

Expected behaviour:
At this point, I would expect the procurement to be done.

Actual behaviour:
The procurement is still in the ready state. Running the scheduler makes no change. If you open the stock move associated with the procurement and mark it as done, then the procurement is done. You might need to run the scheduler first, I can't remember.

Analysis:
The procurement work flow transition from ready to done requires action_check_finnished() to succeed. That checks that the stock move is complete. I happened to notice that action_done() will mark the stock move as complete if the close_move field is true, but action_done won't trigger until the procurement gets to the done state. Catch-22. Perhaps there's some other code that is supposed to mark the stock move as complete, but the close_move field seems like it would never be useful.