inventory icon indicating copy to clipboard operation
inventory copied to clipboard

Product sku change results in shipments not processing (index table does not account for previous sku used)

Open tschirmer opened this issue 3 years ago • 2 comments

Preconditions (*)

  • Magento 2.3.7

Steps to reproduce (*)

  1. Create Product with SKU "test"
  2. Set qty to 50
  3. Add inventory to Source
  4. Process order with product in it
  5. Change SKU from "test" to "test-1"
  6. Reindex Inventory
  7. Attempt to create shipment for order made in step 4.

Expected result (*)

  1. Shipment should be created

Actual result (*)

  1. Error occurs: "Source item not found by source code: default and sku: test"

I've attached a screenshot from a live installation with parts blacked out: image

This occurs because the inventory_source_item table contains ONLY the new sku after indexing the new change, and the shipment is attempting to process the old sku. The fix for this is to include the product entity_id within the table, and index the sku column. then when processing orders and shipments (all backend interactions actually), refer and use to the product entity_id and NOT the sku (after all, the product entity_id is the unique identifier for the product, not the sku).

tschirmer avatar May 31 '21 00:05 tschirmer

Hi @tschirmer. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.

Please, add a comment to assign the issue: @magento I am working on this


m2-assistant[bot] avatar May 31 '21 00:05 m2-assistant[bot]

Bump

tschirmer avatar Dec 09 '21 00:12 tschirmer