Kowal Reservation Cleaner for Magento 2

€56.94 €46.29
Expandable module
M2-REZ-CEANER
PayPal PayPal
Przelew Przelew

YOU CAN TRUST US

25 years of experience in e-commerce and Magento 2

Tooltip

Fast delivery

Tooltip

Efficient implementation process

Tooltip

Simple and transparent complaint process

Tooltip

Working with clients worldwide

Tooltip

Free module updates

Tooltip

Payment by bank transfer

Tooltip

Who is this module for

This module is a good fit if:

  • stock levels are regularly imported from an ERP
  • Magento is not the primary inventory system
  • MSI reservations disrupt salable quantity
  • you need fast, predictable, and automated reservation cleanup
  • the store runs on multiple stocks and cleanup should cover only selected ones

This module is not intended for stores that manage inventory exclusively in Magento and rely on full real-time MSI logic.

The problem it solves

In standard Magento 2 with MSI, each order, cancellation, and shipment writes data to inventory_reservation. In ERP-integrated environments, these records often stop being operationally needed, but they still affect product availability and stock diagnostics.

Most common outcomes:

  • reduced salable quantity
  • mismatches between Magento and ERP
  • growing number of records in inventory_reservation
  • harder inventory issue troubleshooting
  • additional load for availability-related calculations

Key features

  • automatic execution via Magento CRON
  • manual execution via CLI
  • full_reset, log_only, and clean_after_erp_sync modes
  • protection against parallel process execution
  • optional reindex after cleanup
  • optional cache clean after completion
  • technical logging to a file
  • ability to limit cleanup to selected stocks

How the module works

The module registers a frequently scheduled CRON job, but actual execution happens only when the current time matches the configuration. This avoids rebuilding the system schedule dynamically after every settings change.

Process flow:

  1. Check whether the module is enabled.
  2. Check whether the environment is allowed.
  3. Check the schedule window.
  4. Acquire a process lock.
  5. Count reservation records.
  6. Run cleanup or log only.
  7. Optional reindex.
  8. Optional cache clean.
  9. Release lock and write the log.

Operating modes

Full Reset

The simplest and fastest option for ERP-first stores.

When cleanup applies to all stocks, the module uses:

TRUNCATE TABLE inventory_reservation

This is the most efficient solution for large record volumes.

Log Only

Diagnostic mode. The module does not delete data, it only counts records and writes the result to the log.

Clean After ERP Sync

Designed to run right after an ERP stock import. Functionally it cleans reservations like full_reset, but it helps organize the deployment model and scheduling.

Cleanup only for selected stocks

The module also supports cleaning only the specified stocks.

Behavior:

  • if the stock list is empty, the entire reservation table is cleaned
  • if specific stocks are provided, the module deletes only records for those stock_id

In that case a selective query is used:

DELETE FROM inventory_reservation WHERE stock_id IN (...)

This approach is slower than TRUNCATE, but it preserves reservations for other stocks and provides more control in complex deployments.

Business benefits

  • better stock consistency between Magento and ERP
  • fewer issues related to salable quantity
  • simpler inventory diagnostics
  • lower risk of MSI accumulating unnecessary data
  • can be implemented without disabling Magento MSI
  • predictable, fast process that can be automated

Configuration

Admin panel:

Stores -> Configuration -> Kowal -> Reservation Cleaner

Key settings:

  • enable or disable the module
  • select operating mode
  • run hour and minute
  • select stocks to clean
  • enable reindex
  • reindex type
  • cache clean after the process
  • logging
  • lock TTL
  • restrict execution to selected environments

Running from CLI

Base command:

bin/magento kowal:reservation:clean

Example usage:

bin/magento kowal:reservation:clean --mode=full_reset bin/magento kowal:reservation:clean --mode=log_only bin/magento kowal:reservation:clean --reindex=inventory_only bin/magento kowal:reservation:clean --dry-run=1 bin/magento kowal:reservation:clean --stocks=1,2

This allows running the module manually, for testing, or directly after an ERP import completes.

Logging and safety

The technical log is written to:

var/log/kowal_reservation_cleaner.log

The module includes:

  • process locking
  • exception handling
  • environment validation
  • time slot validation
  • ability to operate in log_only mode

The most practical setup for ERP-first stores:

  • full_reset mode
  • logging enabled
  • schedule set shortly after the ERP import
  • inventory_only reindex or handled separately in the integration process
  • leave stocks empty for a full cleanup or specify stocks where a selective variant is required

Limitations

This module:

  • does not fix MSI logic
  • does not reconstruct reservation history
  • does not replace a properly designed ERP integration
  • is not a universal solution for every Magento store

It is a specialized tool for deployments where the ERP controls the real inventory source of truth.

Package and module name

  • Magento module: Kowal_ReservationCleaner
  • Composer package: kowal/reservation-cleaner

CTA

Need implementation or tailoring for your ERP integration, multiple stocks, or a custom schedule? Contact us via kowal.store and describe your inventory synchronization model.

Installation and usage guide for Kowal Reservation Cleaner for Magento 2. Configure CRON schedule, select operating mode, optionally enable reindex and cache clean, and run the CLI command for manual or post-ERP-sync execution.
Changelog: Adds CRON-driven and CLI-triggered reservation cleanup with full_reset, log_only, and clean_after_erp_sync modes. Includes process lock, optional reindex and cache clean, technical logging, and stock_id based selective cleanup support.

Pytania i odpowiedzi

Question
Do czego służy moduł Kowal Reservation Cleaner?
Answer
Moduł służy do automatycznego lub ręcznego czyszczenia tabeli `inventory_reservation` w Magento 2. Jest przeznaczony głównie dla sklepów, w których stany magazynowe są synchronizowane z ERP lub WMS, a Magento nie jest głównym źródłem prawdy o dostępności
Question
Czy moduł wyłącza MSI w Magento 2?
Answer
Nie. Moduł nie odinstalowuje MSI i nie ingeruje w core Magento. Jego zadaniem jest wyłącznie kontrolowane zarządzanie wpisami w `inventory_reservation`, tak aby ograniczyć problemy z dostępnością i `salable quantity` w modelu ERP-first.
Question
Czy można czyścić rezerwacje tylko dla wybranych stocków?
Answer
Tak. Moduł pozwala wskazać konkretne stocki do czyszczenia. Jeśli lista stocków pozostaje pusta, moduł czyści całą tabelę. Jeśli wskażesz wybrane stocki, usuwane są tylko rezerwacje dla wskazanych `stock_id`.
Question
Jak można uruchamiać moduł?
Answer
Moduł można uruchamiać automatycznie z Magento CRON albo ręcznie z poziomu CLI. Dzięki temu może działać według harmonogramu z panelu administracyjnego albo być wywoływany bezpośrednio po imporcie ERP przez zewnętrzny proces integracyjny.
Question
Czy moduł nadaje się do każdego sklepu Magento?
Answer
Nie. To rozwiązanie wyspecjalizowane dla wdrożeń ERP-first. Jeśli Magento samodzielnie zarządza stanami magazynowymi i pełna logika MSI ma pozostać kluczowym mechanizmem kontroli dostępności, taki moduł może nie być właściwym wyborem. Najpierw warto ocenić model biznesowy i architekturę synchronizacji stanów.
Write Your Own Review
You're reviewing:Kowal Reservation Cleaner for Magento 2
Your Rating
Aktualizacja preferencji plików cookie