Skip to content

Unable to ship / notify ready for pickup when an MSI pickup order has some items refunded #36783

Open
@ArronKing

Description

@ArronKing

Preconditions and environment

  • 2.4.5
  • MSI enabled with store pickup

Steps to reproduce

  1. Setup an MSI store - "Warehouse" and "Store" as stock sources
  2. Enable "Store" as pickup location
  3. Create "Website" stock - "Warehouse" and "Store" as the stock sources, sales channel should be the website
  4. Create 2 products, Product A - stock of 10 at "Store", Product B - stock of 10 at "Store"
  5. 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"
  6. 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).
  7. 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”.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: Inventory / MSIComponent: InventoryIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: ready for devReported on 2.4.5Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions