Spree::StockMovement object is created every time that a stock item moves in
or out of a stock location. This objects documents how many items were added or
Spree::StockMovement model has the following attributes:
stock_item_id: The ID of the
Spree::StockItemthe movement is related to.
quantity: The amount of stock items added or removed from the
originator_id: The model and ID of an object that initiated the creation of the current stock movement. For example, an originator could be an administrator (a
Spree::User) adding new stock or a
Spree::Shipmentbeing created after an order is placed.
A typical example of a stock movement would be when a customer buys an item from your store:
Spree::StockMovementobject is created.
Spree::Shipmentbecause a new shipment triggered the movement.
count_on_handvalue is updated to
Administrators can generate stock movements by changing the "Count On Hand"
value for a stock item in the
solidus_backend (on the Stock page).
However, they cannot create a stock movement directly.
Because of this, Solidus has no concept of adding to existing inventory. For example:
Spree::StockMovementwith a quantity of
7 + 25 = 33.)
If an administrator does not account for the units already in stock, they may enter the wrong value into the "Count On Hand" field for an item.
For example, if the administrator changes the value from
25, then the
stock movement only documents that
18 units were added to inventory. (
7 + 18
Solidus is an open source platform supported by the community. We encourage everyone using Solidus to contribute back to the documentation and the code.
If you’re interested in contributing to the docs, get started with the contributing guidelines. If you see something that needs fixing and can’t do it yourself, please send us an email.