Open
Description
Preconditions (*)
- Spotted on
2.4.4-p2
enterprise
Steps to reproduce (*)
cataloginventory/options/synchronize_with_catalog=0
(default this is the default value)- Create a sku with an inventory source
- Purchase the product
- invoice the order
- Delete the sku via the rest api
- See that the product is missing in
catalog_product_entity
- See that the product still exists inside
inventory_source_item
select * from inventory_source_item where sku not in (select sku from catalog_product_entity) and sku in (select sku from sales_order_item)
- See that the product is missing in
- In the admin panel go sales -> order, view your order, pick the invoice, click "credit memo" and see an error page and the following stack trace
[2023-03-03T14:15:41.489918+00:00] report.CRITICAL: TypeError: Magento\InventoryConfiguration\Model\IsSourceItemManagementAllowedForProductType\Interceptor::execute(): Argument #1 ($productType) must be of type string, null given, called in vendor/magento/module-inventory-sales/Model/GetProductSalableQty.php on line 108 and defined in generated/code/Magento/InventoryConfiguration/Model/IsSourceItemManagementAllowedForProductType/Interceptor.php:20
Stack trace:
#0 vendor/magento/module-inventory-sales/Model/GetProductSalableQty.php(108): Magento\InventoryConfiguration\Model\IsSourceItemManagementAllowedForProductType\Interceptor->execute()
#1 vendor/magento/module-inventory-sales/Model/GetProductSalableQty.php(75): Magento\InventorySales\Model\GetProductSalableQty->validateProductType()
#2 vendor/magento/module-inventory-sales-admin-ui/Model/GetSalableQuantityDataBySku.php(84): Magento\InventorySales\Model\GetProductSalableQty->execute()
#3 vendor/magento/module-inventory-sales-admin-ui/Model/GetIsManageStockForProduct.php(95): Magento\InventorySalesAdminUi\Model\GetSalableQuantityDataBySku->execute()
#4 vendor/magento/module-inventory-sales-admin-ui/Model/GetIsManageStockForProduct.php(66): Magento\InventorySalesAdminUi\Model\GetIsManageStockForProduct->getProductStockIds()
#5 vendor/magento/module-inventory-sales-admin-ui/Plugin/Sales/Block/Items/Renderer/DefaultRenderer/ChildManageStockIsOn.php(59): Magento\InventorySalesAdminUi\Model\GetIsManageStockForProduct->execute()
Because we have an inventory_source_item
but no product, we are doing a stock check and getting a PHP fatal error.
Expected result (*)
- I can create a credit memo
Actual result (*)
- I can not create a credit memo