inventory icon indicating copy to clipboard operation
inventory copied to clipboard

Default source check missing on source item decrement for Legacy stock status update

Open nmarquez2 opened this issue 3 years ago • 2 comments

Preconditions (*)

  1. Magento Inventory Version: 1.2.1-p1, develop
  2. Magento Version 2.4.3-p1

Steps to reproduce (*)

  1. Decrement a source item for a source that is not the Default source

Expected result (*)

  1. The legacy stock status should not be updated if the decremented source item is not for the default source

Actual result (*)

  1. Legacy stock status is updated regardless of the source code

There is missing source code check at the beginning of the for loop in the SynchronizeLegacyStockAfterDecrementStockPlugin plugin https://github.com/magento/inventory/blob/develop/InventoryCatalog/Plugin/InventoryApi/SynchronizeLegacyStockAfterDecrementStockPlugin.php#L102

The check is already implemented in \Magento\InventoryCatalog\Model\ResourceModel\DecrementQtyForLegacyStock called a line 99 https://github.com/magento/inventory/blob/develop/InventoryCatalog/Plugin/InventoryApi/SynchronizeLegacyStockAfterDecrementStockPlugin.php#L99

nmarquez2 avatar Jan 14 '22 14:01 nmarquez2

Hi @nmarquez2. Thank you for your report. To speed up processing of this issue, make sure that you provided sufficient information.

Add a comment to assign the issue: @magento I am working on this


m2-assistant[bot] avatar Jan 14 '22 14:01 m2-assistant[bot]

Hi all, Do you have any updates about this issue? Because it's also reproducible in Magento 2.4.3-p2

ayangolenko avatar Jul 11 '22 12:07 ayangolenko