To cover scenarios where the source items table is cleaned up upon delete, versus not
Fix an indexing issue when set to realtime (like when running the tests) and you delete a product, then cancel the order.
There were 2 errors:
1) Ampersand\DisableStockReservation\Test\Integration\Cancel\CancelOrderWithDeletedProduct::testCancelOrderWithDeletedProductAndNotSyncWithCatalog
Magento\Framework\Exception\InputException: Bad value was supplied.
/var/www/html/vendor/magento/module-catalog/Model/Indexer/Product/Price/Action/Rows.php:106
/var/www/html/vendor/magento/module-catalog/Model/Indexer/Product/Price.php:95
/var/www/html/vendor/magento/framework/Interception/Interceptor.php:58
/var/www/html/vendor/magento/framework/Interception/Interceptor.php:138
/var/www/html/vendor/magento/framework/Interception/Interceptor.php:153
/var/www/html/generated/code/Magento/Catalog/Model/Indexer/Product/Price/Interceptor.php:32
/var/www/html/vendor/magento/module-indexer/Model/Indexer.php:533
/var/www/html/vendor/magento/module-indexer/Model/Indexer/DependencyDecorator.php:294
/var/www/html/vendor/magento/framework/Indexer/AbstractProcessor.php:69
/current_extension/src/Service/ExecuteSourceDeductionForItems.php:172
/current_extension/src/Observer/CancelOrderItemObserver.php:55
Fix an issue where you cannot cancel an order, when you have deleted a product and also its source item, then cancel the order
2) Ampersand\DisableStockReservation\Test\Integration\Cancel\CancelOrderWithDeletedProduct::testCancelOrderWithDeletedProductAndSyncWithCatalog
Magento\Framework\Exception\NoSuchEntityException: Source item not found by source code: default and sku: product_will_be_deleted64b130378bd4d.
/var/www/html/vendor/magento/module-inventory-source-deduction-api/Model/GetSourceItemBySourceCodeAndSku.php:59
/current_extension/src/Model/SourceDeductionService/PatchedSourceDeductionService.php:82
/current_extension/src/Model/SourceDeductionService.php:30
/current_extension/src/Service/ExecuteSourceDeductionForItems.php:166
/current_extension/src/Observer/CancelOrderItemObserver.php:55
/var/www/html/vendor/magento/framework/Event/Invoker/InvokerDefault.php:88
/var/www/html/vendor/magento/framework/Event/Invoker/InvokerDefault.php:74
/var/www/html/vendor/magento/framework/Event/Manager.php:65
/var/www/html/generated/code/Magento/Framework/Event/Manager/Proxy.php:95
/var/www/html/vendor/magento/module-sales/Model/Order/Item.php:410
/var/www/html/vendor/magento/module-sales/Model/Order.php:1319
/var/www/html/vendor/magento/module-sales/Model/Order.php:1279
/current_extension/dev/MagentoTests/Integration/Cancel/CancelOrderWithDeletedProductTest.php:229
Checklist
[x] Pull request has a meaningful description of its purpose, include affected Magento versions if it is a bug.
[x] All commits are accompanied by meaningful commit messages
[x] Tests have been ran / updated (see ./dev/README.md for how to run tests)
Prerequisites
To cover scenarios where the source items table is cleaned up upon delete, versus not
Fix an indexing issue when set to
realtime
(like when running the tests) and you delete a product, then cancel the order.Fix an issue where you cannot cancel an order, when you have deleted a product and also its source item, then cancel the order
Checklist
./dev/README.md
for how to run tests)