This module disables the inventory reservation logic introduced as part of MSI in Magento 2.3.3
GNU Lesser General Public License v3.0
211
stars
60
forks
source link
Unable to cancel orders placed prior to module installation #130
Closed
MatthieuCardin closed 9 months ago
Hi!
The cancel action from the admin do not work with any order passed before the module installation. Error shown is:
Source model with the order ID "12345" does not exist
The reason is that past orders do not have any row in the
order_sources
table. The exception is thrown from:src/Model/SourcesRepository.php::getByOrderId(string $orderId)
Workaround: In our case, we manually added a row in the
order_sources
table for orders we wanted to cancel.Fix I think you should fix this part of the code:
src/Observer/CancelOrderItemObserver.php :
$this->executeSourceDeductionForItems->executeSourceDeductionForItems($orderItem, $itemsToCancel, true);
when the order is not found, do nothing instead of throwing the exception.
Best regards, Matthieu Cardin Valtech