ampersand / magento2-disable-stock-reservation
This module disables the inventory reservation logic introduced as part of MSI in Magento 2.3.3
Installs: 1 219 721
Dependents: 0
Suggesters: 0
Security: 0
Stars: 225
Watchers: 16
Forks: 65
Open Issues: 18
Type:magento2-module
pkg:composer/ampersand/magento2-disable-stock-reservation
Requires
- php: ^7.1|^8.0
- magento/framework: >=103
Requires (Dev)
- 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
- dev-master
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.9
- 1.2.8
- 1.2.7
- 1.2.6
- 1.2.5
- 1.2.4
- 1.2.3-p1
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.16
- 1.0.15
- 1.0.14
- 1.0.13
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-fix/142__Duplicate-Options-in-Bundle-Product-Deduction
- dev-fix/135__foreign_key_constraint
- dev-feature/fix-failing-test-instances
- dev-fix_static_analysis_issues
- dev-feature/test-case-for-bundles
This package is auto-updated.
Last update: 2025-10-22 14:11:16 UTC
README
This module disables the inventory reservation logic introduced as part of MSI in Magento 2.3.3 - see magento/inventory#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_reservationtable. It does so by using anaroundplugin onPlaceReservationsForSalesEventInterface - Trigger stock deductions on order placement. See
inventory_sales_source_deduction_processorplugin onMagento\Sales\Model\Service\OrderService. - Prevent stock deductions on order shipment. See disabled
inventory_sales_source_deduction_processorobserver onsales_order_shipment_save_afterevent. - Replenish stock for cancelled order items. See
inventoryobserver onsales_order_item_cancelevent. - Replenish stock when a credit memo is issued. See
src/Observer/RestoreSourceItemQuantityOnRefundObserver.php- Requires that "Back to stock" is checked or "Automatically Return Credit Memo Item to Stock" is configured
- Truncate (ie, remove all historic entries from) the
inventory_reservationtable upon installation.
Additional Notes
- Both the
inventoryandcataloginventory_stockshould be on the same mode (Update on SaveorSchedule) for this module to work as expected. If you are running this onScheduleyou should have crons activated.