inventory
inventory copied to clipboard
Product sku change results in shipments not processing (index table does not account for previous sku used)
Preconditions (*)
- Magento 2.3.7
Steps to reproduce (*)
- Create Product with SKU "test"
- Set qty to 50
- Add inventory to Source
- Process order with product in it
- Change SKU from "test" to "test-1"
- Reindex Inventory
- Attempt to create shipment for order made in step 4.
Expected result (*)
- Shipment should be created
Actual result (*)
- 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:
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).
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
- Join Magento Community Engineering Slack and ask your questions in #github channel.
Bump