cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with inconsistent salable quantities in Magento store

Issue with inconsistent salable quantities in Magento store

I am encountering an issue with inconsistent salable quantities, which is leading to inventory mismanagement problems in my Magento 2 store. To address this issue, I have installed the AmpersandHQ/magento2-disable-stock-reservation module from GitHub (link: AmpersandHQ/magento2-disable-stock-reservation) to prevent stock reservation. However, after installation, I've noticed that some records are still being added to the inventory reservation table.

Upon investigation, I found that all these records share the same event type (manual_compensation) in the metadata column:

 

{
  "event_type": "manual_compensation",
  "object_type": "order",
  "object_id": "51232",
  "object_increment_id": "ORDER-52120-2"
}

I would like to understand the concept of manual_compensation and how I can prevent these entries from being added to the inventory reservation table. Any insights or guidance on resolving this issue would be greatly appreciated.

4 REPLIES 4

Re: Issue with inconsistent salable quantities in Magento store

The only place where manual_compensation appears is vendor/magento/module-inventory-reservation-cli/Command/Input/GetReservationFromCompensationArgument.php

 

Unless you have something custom that does that.

 

So are you or someone from your team running that CLI command?

Founder at https://agency418.com

Re: Issue with inconsistent salable quantities in Magento store

@toniagency82ed We do not have any custom code triggering this process, nor are we executing that command ourselves.

Re: Issue with inconsistent salable quantities in Magento store

Now, I have chosen to disable all MSI modules because we are utilizing a single source inventory system. However, after disabling the MSI modules, products are no longer visible on category pages.

 

Here are the steps I followed:


1. Disable MSI modules

php bin/magento module:disable -f Magento_Inventory Magento_InventoryAdminUi Magento_InventoryApi Magento_InventoryBundleProduct Magento_InventoryBundleProductAdminUi Magento_InventoryCatalog Magento_InventorySales Magento_InventoryCatalogAdminUi Magento_InventoryCatalogApi Magento_InventoryCatalogSearch Magento_InventoryConfigurableProduct Magento_InventoryConfigurableProductAdminUi Magento_InventoryConfigurableProductIndexer Magento_InventoryConfiguration Magento_InventoryConfigurationApi Magento_InventoryGroupedProduct Magento_InventoryGroupedProductAdminUi Magento_InventoryGroupedProductIndexer Magento_InventoryImportExport Magento_InventoryIndexer Magento_InventoryLowQuantityNotification Magento_InventoryLowQuantityNotificationAdminUi Magento_InventoryLowQuantityNotificationApi Magento_InventoryMultiDimensionalIndexerApi Magento_InventoryProductAlert Magento_InventoryReservations Magento_InventoryReservationsApi Magento_InventoryCache Magento_InventorySalesAdminUi Magento_InventorySalesApi Magento_InventorySalesFrontendUi Magento_InventoryShipping Magento_InventorySourceDeductionApi Magento_InventorySourceSelection Magento_InventorySourceSelectionApi Magento_InventoryShippingAdminUi Magento_InventoryDistanceBasedSourceSelectionAdminUi Magento_InventoryDistanceBasedSourceSelectionApi Magento_InventoryElasticsearch Magento_InventoryExportStockApi Magento_InventoryReservationCli Magento_InventoryExportStock Magento_CatalogInventoryGraphQl Magento_InventorySetupFixtureGenerator Magento_InventoryAdvancedCheckout Magento_InventoryDistanceBasedSourceSelection Magento_InventoryRequisitionList Magento_InventoryGraphQl Magento_InventoryBundleImportExport Magento_InventoryBundleProductIndexer Magento_InventoryInStorePickupApi Magento_InventoryInStorePickupAdminUi Magento_InventoryInStorePickup Magento_InventoryInStorePickupGraphQl Magento_InventoryInStorePickupShippingApi Magento_InventoryInStorePickupQuoteGraphQl Magento_InventoryInStorePickupSales Magento_InventoryInStorePickupSalesApi Magento_InventoryInStorePickupQuote Magento_InventoryInStorePickupShipping Magento_InventoryInStorePickupShippingAdminUi Magento_InventoryInStorePickupFrontend Magento_InventoryInStorePickupMultishipping Magento_InventoryInStorePickupSalesAdminUi Magento_InventoryInStorePickupWebapiExtension Magento_InventoryCatalogFrontendUi Magento_InventoryConfigurableProductFrontendUi Magento_InventorySwatchesFrontendUi Magento_InventoryVisualMerchandiser Magento_InventoryWishlist --clear-static-content


2. Executed Magento commands

php bin/magento s:up
php bin/magento s:d:c
php bin/magento s:s:d -f
php bin/magento ind:reset
php bin/magento ind:reindex
php bin/magento cac:flush

Re: Issue with inconsistent salable quantities in Magento store

Hello @Ashwani Rana,

 

If the project does not have any custom code, check the payment method and check all the cases (order placing, order cancelation, order return etc). I have encountered recently with same issue and checked all code, but it was coming from a KNOWN payment method codebase.

 

In my case, it was returning double quantity in stocks when someone cancels the order.

 

I hope it helps!

Problem Solved ? Click on 'Kudos' & Accept as Solution ! Smiley Happy