Open codebase-md opened 2 years ago
Hi @codebase-md. 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
Can you please assign this ticket to me I will work on it? Thanks @magento I am working on this
Preconditions (*)
Steps to reproduce (*)
Expected result (*)
Actual result (*)
Additional Information
I debugged the whole process and found following:
Order of execution
In step 4 (\Magento\InventoryCatalog\Model\SourceItemsSaveSynchronization\SetDataToLegacyCatalogInventory::updateSourceItems) the stock status is fetched from the exact same table that this function tries to update(cataloginventory_stock_status) if the stock id is equal to the default stock id. Hence the old value is reused when executing the status update on line 205(\Magento\InventoryCatalog\Model\SourceItemsSaveSynchronization\SetDataToLegacyCatalogInventory)