ampersand / magento2-disable-stock-reservation

ampersand/magento2-disable-stock-reservation

magento2-module Compatibility: 2.4.7-2.4.8 Code Quality: Fail Tests: N/A Security: Pass

AmpersandHQ/magento2-disable-stock-reservation

Build Status

This module disables the inventory reservation logic introduced as part of MSI in Magento 2.3.3 - see
https://github.com/magento/inventory/issues/2269 for more information about the way MSI was implemented, and the issues
that can happen with external WMS integrations.

The Problem

During the order placement and fulfilment processes, Magento's MSI implementation will not decrement stock on order
placement - it will only do so on order shipment and refund.

Our Approach

This module will:

  • Prevent all writes to the inventory_reservation table. It does so by using an around plugin on PlaceReservationsForSalesEventInterface
  • Trigger stock deductions on order placement. See inventory_sales_source_deduction_processor plugin on Magento\Sales\Model\Service\OrderService.
  • Prevent stock deductions on order shipment. See disabled inventory_sales_source_deduction_processor observer on sales_order_shipment_save_after event.
  • Replenish stock for cancelled order items. See inventory observer on sales_order_item_cancel event.
  • Replenish stock when a credit memo is issued. See src/Observer/RestoreSourceItemQuantityOnRefundObserver.php
  • Truncate (ie, remove all historic entries from) the inventory_reservation table upon installation.

Additional Notes

  • Both the inventory and cataloginventory_stock should be on the same mode (Update on Save or Schedule) for this module to work as expected. If you are running this on Schedule you should have crons activated.

No changelog yet

The vendor hasn't published a changelog. Tagged releases appear in the Versions tab.

Versions
Version Stability QA Status Compatibility Released
1.3.4 stable Fail Magento 2.4.7-2.4.8 Details 2026-01-21 08:11:00
1.3.3 stable Not tested Not yet tested Details 2025-06-30 07:05:52
1.3.2 stable Not tested Not yet tested Details 2024-02-19 08:15:32
1.3.1 stable Not tested Not yet tested Details 2023-12-07 10:50:43
1.3.0 stable Not tested Not yet tested Details 2023-10-12 12:07:47
1.2.9 stable Not tested Not yet tested Details 2023-08-08 07:11:55
1.2.8 stable Not tested Not yet tested Details 2023-08-01 16:55:38
1.2.7 stable Not tested Not yet tested Details 2023-06-22 14:01:29
1.2.6 stable Not tested Not yet tested Details 2023-05-30 09:18:20
1.2.5 stable Not tested Not yet tested Details 2023-04-28 11:17:34
1.2.4 stable Not tested Not yet tested Details 2023-04-25 15:21:17
1.2.3-p1 stable Not tested Not yet tested Details 2023-04-24 08:14:01
1.2.3 stable Not tested Not yet tested Details 2023-01-16 09:37:12
1.2.2 stable Not tested Not yet tested Details 2022-11-15 17:11:52
1.2.1 stable Not tested Not yet tested Details 2022-10-04 16:29:25
1.2.0 stable Not tested Not yet tested Details 2022-10-04 15:56:23
1.1.4 stable Not tested Not yet tested Details 2022-06-07 13:24:54
1.1.3 stable Not tested Not yet tested Details 2022-04-22 08:25:23
1.1.2 stable Not tested Not yet tested Details 2021-11-29 15:12:39
1.1.1 stable Not tested Not yet tested Details 2021-11-29 14:30:25
1.1.0 stable Not tested Not yet tested Details 2021-11-29 14:04:41
1.0.16 stable Not tested Not yet tested Details 2021-04-15 10:39:48
1.0.15 stable Not tested Not yet tested Details 2021-02-23 12:43:49
1.0.14 stable Not tested Not yet tested Details 2021-02-18 09:14:04
1.0.13 stable Not tested Not yet tested Details 2021-02-15 15:18:27
1.0.12 stable Not tested Not yet tested Details 2021-01-07 10:33:04
1.0.11 stable Not tested Not yet tested Details 2020-09-03 08:12:59
1.0.10 stable Not tested Not yet tested Details 2020-07-22 13:59:41
1.0.9 stable Not tested Not yet tested Details 2020-06-22 10:22:24
1.0.8 stable Not tested Not yet tested Details 2020-06-09 10:20:15
1.0.7 stable Not tested Not yet tested Details 2020-04-09 10:39:56
1.0.6 stable Not tested Not yet tested Details 2020-04-06 07:52:37
1.0.5 stable Not tested Not yet tested Details 2020-03-26 13:47:59
1.0.4 stable Not tested Not yet tested Details 2020-02-14 15:14:47
1.0.3 stable Not tested Not yet tested Details 2019-11-26 11:56:43
1.0.2 stable Not tested Not yet tested Details 2019-11-19 09:54:30
1.0.1 stable Not tested Not yet tested Details 2019-11-06 15:56:36
1.0.0 stable Not tested Not yet tested Details 2019-11-06 11:25:13

Requires 2

Package Constraint
magento/framework >=103
php ^7.1|^8.0

Requires-dev 9

Package Constraint
ampersand/magento-docker-test-instance ^0.1
codeception/codeception ^4.1.1
codeception/module-asserts ^1.1.0
codeception/module-db ^1.0.1
codeception/module-phpbrowser ^1.0.0
codeception/module-rest ^1.2.0
friendsofphp/php-cs-fixer ^2.16
magento/magento-coding-standard <16
tddwizard/magento2-fixtures ^1.1

Compatibility

Each Magento release line is installed on its supported PHP versions, then the module is built (DI compilation + static-content deploy) and its unit and integration suites are run. The matrix shows the lines and PHP versions the module is confirmed to install and run on. Code-quality results further down (phpstan, phpcs, …) are reported separately and never affect compatibility.

Compatibility matrix (Magento × PHP)
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 Pass Pass
2.4.8 Pass Pass
2.4.9 Pass Fail di error

Code Quality

Advisory checks against the module's source. Static analysis runs once across the whole module; PHPStan re-runs per Magento + PHP version because resolvable symbols differ between releases. These NEVER affect the Compatibility badge — a phpcs finding can't make a module incompatible.

Static analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

Static analysis results
Tool Status Findings Summary
PHPCS Fail 43 2 errors, 41 warnings (ruleset: Magento2) — 21 auto-fixable with phpcbf
PHPMD Warning 14 14 rule violations (UnusedFormalParameter:10, IfStatementAssignment:2, ExcessiveParameterList:1, UnusedLocalVariable:1)
Cpd Warning 9 9 duplicated chunks spanning 399 total lines (min-lines=5, min-tokens=70)
Composer validate Info 2 valid; 2 advisory notes (composer validate --strict)

PHPStan

Type-checks the module's PHP against a real Magento install at the configured gate level. Re-runs per Magento and PHP version because resolvable symbols differ between releases. Cell → details modal.

PHPStan results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 16 16
2.4.8 16 16
2.4.9 16 17

Tests

Unit and integration suites, run for each applicable Magento and PHP version. A test failure speaks to the module's behaviour, not its compatibility with a Magento line, so it is reported here separately and never reddens the compatibility matrix.

Unit tests

Unit tests results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 N/A N/A
2.4.8 N/A N/A
2.4.9 N/A N/A

Integration tests

Integration tests results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 N/A N/A
2.4.8 N/A N/A
2.4.9 N/A N/A

Security

Security checks run directly against the module: an audit of its declared dependencies for known vulnerabilities (composer audit) and a scan of its source for malware and web-shell signatures. Each runs once. A malware detection fails the version outright.

Security results
Tool Status Findings Summary
Composer audit Pass 0
Malware scan Pass 0

No license declared

This package's composer.json doesn't declare a license, homepage, or authors. Check the source repository for terms of use.

More from ampersand

View vendor
Make it pay

Turn an existing module into recurring revenue.

If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.