Free cookie consent management tool by TermsFeedAktualizacja preferencji plików cookie

Kowal Reservation Cleaner for Magento 2

€56.94 €46.29
COMPOSER Installation
M2-REZ-CEANER
PayPal PayPal
Przelew Przelew

Magento Modules: Clear Guidelines

You purchase the module once, with no domain restrictions

Tooltip

Free installation and updates via Composer

Tooltip

Affiliate Program

Tooltip

Technical support for Magento

Tooltip

Clear guidelines for licensing Magento modules

Tooltip

Magento Module Code Security

Tooltip

Who this module is for

This module is a good fit if:

  • inventory levels are regularly imported from ERP
  • Magento is not the main inventory management system
  • MSI reservations disrupt salable quantity
  • fast, predictable, and automatic reservation cleanup is needed
  • the store operates on multiple stocks and cleanup should include only selected ones

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

The problem it solves

In standard Magento 2 with MSI, subsequent orders, cancellations, and shipments save data in inventory_reservation. In environments with ERP integration, these records often stop being operationally needed, but they still affect product availability and inventory diagnostics.

The most common effects include:

  • understated salable quantity
  • discrepancies between Magento and ERP
  • a growing number of records in inventory_reservation
  • more difficult inventory issue diagnostics
  • additional load on availability-related calculations

Key features

  • automatic execution via Magento CRON
  • manual execution via CLI
  • full_reset, log_only, and clean_after_erp_sync modes
  • lock to prevent the process from running in parallel
  • optional reindexing after cleanup
  • optional cache clean after completion
  • technical logging to a file
  • option to limit cleanup to selected stocks

How the module works

The module registers a CRON job that runs frequently, but the actual execution takes place only when the current time matches the configuration. This means there is no need to dynamically rebuild the system schedule after every settings change.

Process flow:

  1. Check whether the module is active.
  2. Check whether the environment is allowed.
  3. Check the schedule.
  4. Create the process lock.
  5. Count reservation records.
  6. Perform cleanup or logging only.
  7. Optional reindexing.
  8. Optional cache clean.
  9. Release the 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 solution is the most efficient when handling a large number of records.

Log Only

Diagnostic mode. The module does not delete data, but only counts records and saves the result in the log.

Clean After ERP Sync

A mode designed to run immediately after importing inventory levels from ERP. Functionally, it cleans reservations just like full_reset, but it organizes the deployment model and schedule.

Cleanup only for selected stocks

The module also supports a scenario where cleanup is performed only for specified stocks.

How it works:

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

In this case, a selective query is used:

DELETE FROM inventory_reservation WHERE stock_id IN (...)

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

Business benefits

  • better inventory consistency between Magento and ERP
  • fewer errors related to salable quantity
  • simpler inventory diagnostics
  • lower risk of unnecessary data building up in MSI
  • deployment possible without disabling Magento MSI
  • a predictable and fast process that can be automated

Configuration

Admin panel:

Stores -> Configuration -> Kowal -> Reservation Cleaner

Key settings:

  • enable or disable the module
  • select the operating mode
  • execution hour and minute
  • select stocks for cleanup
  • enable reindexing
  • reindexing type
  • cache clean after the process
  • logging
  • lock validity time
  • limit operation to selected environments

Running from CLI

Basic command:

bin/magento kowal:reservation:clean

Example usage:

bin/magento kowal:reservation:clean --mode=full_resetbin/magento kowal:reservation:clean --mode=log_onlybin/magento kowal:reservation:clean --reindex=inventory_onlybin/magento kowal:reservation:clean --dry-run=1bin/magento kowal:reservation:clean --stocks=1,2

This allows you to run the module manually, for testing, or directly after the ERP import is completed.

Logging and security

The technical log is saved to:

var/log/kowal_reservation_cleaner.log

The module includes:

  • process lock
  • exception handling
  • environment control
  • time slot control
  • the ability to work in log_only mode

Recommended deployment model

The most practical option for ERP-first stores:

  • full_reset mode
  • active logging
  • schedule launched shortly after ERP import
  • inventory_only reindexing or reindexing handled separately in the integration process
  • empty stock field for full cleanup, or specified stocks where a selective option 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 all Magento stores

It is a specialized tool for deployments where ERP manages the actual inventory level.

Package and module name

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

CTA

Need implementation or customization of the module for 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.

Questions and Answers

Question
What is the Kowal Reservation Cleaner module used for?
Answer
The module is used to automatically or manually clean the `inventory_reservation` table in Magento 2. It is intended mainly for stores where inventory levels are synchronized with an ERP or WMS, and Magento is not the primary source of truth for availability
Question
Does the module disable MSI in Magento 2?
Answer
No. The module does not uninstall MSI and does not interfere with the Magento core. Its purpose is solely to manage entries in `inventory_reservation` in a controlled way, in order to reduce issues with availability and `salable quantity` in an ERP-first model.
Question
Can reservations be cleared only for selected stocks?
Answer
Yes. The module allows you to specify specific stocks to clear. If the stock list remains empty, the module clears the entire table. If you specify selected stocks, only reservations for the specified `stock_id` are removed.
Question
How can the module be run?
Answer
The module can be run automatically from Magento CRON or manually from the CLI. This allows it to operate according to a schedule from the admin panel or be triggered directly after an ERP import by an external integration process.
Question
Is the module suitable for every Magento store?
Answer
No. This is a specialized solution for ERP-first implementations. If Magento manages inventory levels independently and the full MSI logic is to remain the key mechanism for availability control, this type of module may not be the right choice. It is worth evaluating the business model and inventory synchronization architecture first.
Write Your Own Review
You're reviewing:Kowal Reservation Cleaner for Magento 2
Your Rating
Products