This is my current understanding of OpenERP's stock system, please correct me or confirm my understanding.
Stock moves in OpenERP represent a move of products from one stock.location
to another. A stock.location
represents a physical place or a virtual concept for products that are incoming or outgoing.
When a product is needed in a stock.location
, a procurement.order
is created to fulfill the requirement. This procurement.order
has a stock.move
move_id
attached to it, assigned / created when the procurement.order
transitions from the draft
to the confirmed
state.
The procurement.order
's state tracks the progress of obtaining a stock move, and will only transition to the ready
or complete
state when the stock move's state is set to assigned
or done
. This is checked for make_to_stock
procurements whenever the procurement moves past the confirmed
state, and depending on the stock move's state, the procurement can then move to ready
, complete
, or exception. This is checked for
make_to_order` procurements when the procurement's subflow (buy or produce) is completed.
When a stock.move
is completed by any means (state changes to done
via action_done()
), it moves from the waiting
or confirmed
state to the assigned
state. At this point, if the move_dest_id
field is not empty, the code checks to see if all other moves with the same move_dest_id
field are done. If so, the destination move is marked complete as well (recursively).
So I have a few questions:
What is the point of
move_dest_id
? Is it more or less a way to skip having manual make_to_stock procurements all over the place when a chain of moves is desired?What exactly is this move chain for? I seem to be able to follow it from a sales order move line, into a procurement, through a MO, past the finished product, through each of the component products, though their procurements, through more MOs, etc. Can this be used to display the full path / full chain of products that are needed to ship a sales order line?