Skip to content

Fix \Magento\Sales\Service\V1\ShipmentCreateTest::testInvoke #1339

Closed
@nmalevanec

Description

@nmalevanec

Preconditions

  1. Magento 2 with MSI

Steps to reproduce

  1. Run \Magento\Sales\Service\V1\ShipmentCreateTest::testInvoke()

Expected result

  1. Test passed successfully.

Actual result

  1. 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
image
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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions