Description
Preconditions
- Magento 2 with MSI
Steps to reproduce
- Run \Magento\Sales\Service\V1\ShipmentCreateTest::testInvoke()
Expected result
- Test passed successfully.
Actual result
- Test fails with error:
{"message":"The shipment couldn't be saved."}
Details
Test sends incorrect request body for shipment creation:
"items": [ { "order_item_id": "4", "qty": "2.0000", "additional_data": null, "description": null, "entity_id": null, "name": null, "parent_id": null, "price": null, "row_total": null, "weight": null } ],
without specifying product id (entity_id) in shipment items, which leads to broken shipment on mainline
And error {"message":"The shipment couldn't be saved."} on MSI. Triggered by https://github.com/magento-engcom/msi/blob/d70307965d038e8434d538893f4f2a542fac2fbc/app/code/Magento/InventoryShipping/Model/GetItemsToDeduct.php#L64
and
https://github.com/magento-engcom/msi/blob/d70307965d038e8434d538893f4f2a542fac2fbc/app/code/Magento/InventoryCatalog/Model/GetSkusByProductIds.php#L46-L49