Description
Preconditions and environment
- 2.4.5
- MSI enabled with store pickup
Steps to reproduce
- Setup an MSI store - "Warehouse" and "Store" as stock sources
- Enable "Store" as pickup location
- Create "Website" stock - "Warehouse" and "Store" as the stock sources, sales channel should be the website
- Create 2 products, Product A - stock of 10 at "Store", Product B - stock of 10 at "Store"
- Place an order on the frontend, ordering 10 x Product A and 10 x Product B. Make sure the order is a "pickup" from "Store"
- Login as an admin, issue a refund on the order for Product A. And drop it's quantity to 0. (Simulating where Product A isn't actually in stock, we've only just realised so we'll refund the customer and correct stock level).
- Try to Ship / "Notify Order is Ready for Pickup"
Expected result
Order is shipped, customer is notified. Shipment should only contain 10 x Product B as we've refunded Product A.
Actual result
Admin is told "The order is not ready for pickup" - unable to ship
Additional information
Exception is thrown from Magento\InventoryInStorePickupSales\Model\Order:57
Tracing that back, bug is in Magento\InventoryInStorePickupSales\Model\Order\IsFulfillable:77
:
if (!$this->isItemFulfillable($item->getSku(), $sourceCode, (float)$item->getQtyOrdered())) {
That line checks if there's enough stock to fulfil the items quantity ordered. That shouldn't be the case, it needs to check on the level it needs to ship.
To workaround this issue you need to give Product A enough stock to pass this check.
When the shipment is created, product A isn't on the shipment (which is correct).
Then re-adjust Product A stock level
Release note
No response
Triage and priority
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.