Inventory units stay `on_hand` after an order is canceled
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 5.3k
- Forks
- 1.4k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 62
Description
Is your feature request related to a problem? Please describe.
When I cancel and order, the inventory units remain on_hand
# Canceled order
order.inventory_units.pluck(:state) => ["on_hand"]
Steps to recreate
- Create an order and complete it
- Cancel the order by clicking the "Cancel" button
- Notice that the order state is
canceled, the shipment state itcanceled, but the inventory units states remainon_hand(see screenshot below)
Describe the solution you'd like
When I cancel an order, the inventory units state should also change to canceled
# Desired return for canceled order
order.inventory_units.pluck(:state) => ["canceled"]`
Describe alternatives you've considered
Additional context
The issue we've specifically had has been with our warehouse system. The inventory units have to be canceled so our CSRs have to cancel and order, and cancel all the items under the "Cancel Items" tab. But it does seem strange that when you cancel an order the inventory units are not also canceled. We set the shipment state to cancelled so I would assume we do the same for the inventory units.

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the order-cancellation flow and comparing how shipment and inventory-unit states are handled. Reproduce the cancellation scenario, then verify that canceling an order leaves its inventory units in the canceled state while preserving the existing canceled order and shipment states.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rails, ruby
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100