Skip to content

Fatal error when you try to ship the invoiced product if the product was removed after invoicing #1236

@TomashKhamlai

Description

@TomashKhamlai

Preconditions

  1. Magento MSI
  2. Multi-Stock Mode
  3. There is a product on Default Stock
  4. The customer placed an Order with the Product

Steps to reproduce

  1. Navigate to Sales > Orders
  2. Submit an Invoice for the recently created order
  3. Navigate to Catalog > Products
  4. Remove the Product that was invoiced recently
  5. Navigate to Sales > Orders
  6. Submit a Shipment of the Order that was invoiced recently

Expected result

  1. Even after deletion of the product from the order, shipment still should be created without warning

Actual result

  1. Fatal error:
( ! ) Fatal error: Uncaught Error: Call to a member function isManageStock() on null in /app/vendor/magento/module-inventory-shipping/Model/SourceDeduction/SourceDeductionService.php on line 116
--



1 | 0.0001 | 450184 | {main}( ) | .../index.php:0
2 | 0.0900 | 5717312 | Magento\Framework\App\Bootstrap->run( ) | .../index.php:37
3 | 0.0915 | 5723048 | Magento\Framework\App\Http\Interceptor->launch( ) | .../Bootstrap.php:256
4 | 0.0989 | 6086344 | Magento\Framework\App\FrontController\Interceptor->dispatch( ) | .../Http.php:135
5 | 0.1030 | 6221272 | Magento\Framework\App\FrontController\Interceptor->___callPlugins( ) | .../Interceptor.php:26
6 | 0.1030 | 6222144 | Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}( ) | .../Interceptor.php:153
7 | 0.1239 | 7240328 | Magento\Framework\App\FrontController\Interceptor->___callParent( ) | .../Interceptor.php:138
8 | 0.1239 | 7240328 | Magento\Framework\App\FrontController\Interceptor->dispatch( ) | .../Interceptor.php:58
9 | 0.2099 | 12023512 | Magento\Shipping\Controller\Adminhtml\Order\Shipment\Save\Interceptor->dispatch( ) | .../FrontController.php:55
10 | 0.2110 | 12110776 | Magento\Shipping\Controller\Adminhtml\Order\Shipment\Save\Interceptor->___callPlugins( ) | .../Interceptor.php:26
11 | 0.2110 | 12111648 | Magento\Shipping\Controller\Adminhtml\Order\Shipment\Save\Interceptor->Magento\Framework\Interception\{closure}( ) | .../Interceptor.php:153
12 | 0.2287 | 12982200 | Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch( ) | .../Interceptor.php:135
13 | 0.2342 | 13066296 | Magento\Shipping\Controller\Adminhtml\Order\Shipment\Save\Interceptor->Magento\Framework\Interception\{closure}( ) | .../Authentication.php:143
14 | 0.2342 | 13066712 | Magento\Shipping\Controller\Adminhtml\Order\Shipment\Save\Interceptor->___callParent( ) | .../Interceptor.php:138
15 | 0.2342 | 13066712 | Magento\Shipping\Controller\Adminhtml\Order\Shipment\Save\Interceptor->dispatch( ) | .../Interceptor.php:58
16 | 0.2797 | 13916928 | Magento\Shipping\Controller\Adminhtml\Order\Shipment\Save\Interceptor->dispatch( ) | .../AbstractAction.php:229
17 | 0.2955 | 14063256 | Magento\Shipping\Controller\Adminhtml\Order\Shipment\Save\Interceptor->execute( ) | .../Action.php:107
18 | 0.4623 | 19890064 | Magento\Shipping\Controller\Adminhtml\Order\Shipment\Save\Interceptor->_saveShipment( ) | .../Save.php:153
19 | 0.4628 | 19906480 | Magento\Framework\DB\Transaction->save( ) | .../Save.php:79
20 | 0.4636 | 19906480 | Magento\Sales\Model\Order\Shipment->save( ) | .../Transaction.php:129
21 | 0.4636 | 19906480 | Magento\Sales\Model\ResourceModel\Order\Shipment\Interceptor->save( ) | .../AbstractModel.php:647
22 | 0.4644 | 19927328 | Magento\Sales\Model\ResourceModel\Order\Shipment\Interceptor->___callPlugins( ) | .../Interceptor.php:39
23 | 0.4644 | 19928200 | Magento\Sales\Model\ResourceModel\Order\Shipment\Interceptor->Magento\Framework\Interception\{closure}( ) | .../Interceptor.php:153
24 | 0.4644 | 19928608 | Magento\Sales\Model\ResourceModel\Order\Shipment\Interceptor->___callParent( ) | .../Interceptor.php:138
25 | 0.4644 | 19928608 | Magento\Sales\Model\ResourceModel\Order\Shipment\Interceptor->save( ) | .../Interceptor.php:58
26 | 0.4837 | 20046976 | Magento\Sales\Model\ResourceModel\Order\Shipment\Interceptor->processAfterSaves( ) | .../AbstractDb.php:418
27 | 0.4863 | 20050120 | Magento\Sales\Model\Order\Shipment->afterSave( ) | .../AbstractDb.php:56
28 | 0.4919 | 20200768 | Magento\Staging\Model\Event\Manager\Proxy->dispatch( ) | .../AbstractModel.php:818
29 | 0.4919 | 20200768 | Magento\Staging\Model\Event\Manager->dispatch( ) | .../Proxy.php:95
30 | 0.4920 | 20201768 | Magento\Framework\Event\Invoker\InvokerDefault->dispatch( ) | .../Manager.php:97
31 | 0.5089 | 20966688 | Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod( ) | .../InvokerDefault.php:60
32 | 0.5089 | 20966688 | Magento\InventoryShipping\Observer\SourceDeductionProcessor->execute( ) | .../InvokerDefault.php:72
33 | 0.5101 | 20987088 | Magento\InventoryShipping\Model\SourceDeduction\SourceDeductionService->execute( ) | .../SourceDeductionProcessor.php:124


Metadata

Metadata

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions