QUALITY PATCH

ACSD-45424: Incorrect reservation compensation is created after a partial refund

Incorrect reservation compensation is created after a partial refund. Quality patch ACSD-45424 for magento/module-inventory-source-selection-api applies to Magento Open Source and Adobe Commerce 2.3.4 to 2.4.5-p17.

Categories
Inventory
Components
magento/module-inventory-source-selection-api
Origin
adobe-commerce-support
Since QPT
1.1.17

Issue

Incorrect reservation compensation is created after a partial refund.

Steps to reproduce

1. Enable in-store delivery shipping method. 1. Create three inventory sources and make sure the pickup location is active in each (source1, source2, source3). 1. Create a new stock and assign the three sources to the new stock. * This stock should be assigned to the main website. 1. Create a simple product, P3, and assign all the sources to it. 1. Add the following quantities for the sources of the simple product and enable backorders: * Default source - 100 * source1 - 0 * source2 - 10 * source3 - 0 1. Add the simple product to the cart from the frontend and proceed to shipping form. 1. Select "source1" as the shipping location. 1. Complete the order and execute the following query in the database: SELECT * FROM inventory_reservation WHERE sku = 'P3'; You will get the order placed record in the inventory_reservation table. The quantity is 10, which is correct. 1. Invoice this order from the backend. 1. Now create a credit memo for only one product. DO NOT select the Return to Stock checkbox. 1. Execute the same query from Step 8.

Adobe's page lists 2.3.4 - 2.4.4 as compatible; the versions below are resolved from the current QPT constraints and are the ones the tool will offer.

Adobe scheduled the permanent fix for 2.4.6.

Install

Install the Quality Patches Tool with composer require magento/quality-patches, apply the prerequisites listed for all files applicable to your distribution and version first, then run vendor/bin/magento-patches apply ACSD-45424. On Cloud, add ACSD-45424 under stage.build.QUALITY_PATCHES in .magento.env.yaml.

For cweagans/composer-patches, choose a compatible version below and download the bundle. Copy its ACSD-45424/ folder into patches/composer/, merge composer.patches.json into composer.json, then run composer install. Bundle prerequisites the same way and list them first. Paths are relative to each package root, using the default -p1 level. Prefer local files when configuring composer-patches; a remote URL can change.

Patch files and compatible versions

Packages across compatible versions (1): magento/module-inventory-source-selection-api
Packages across compatible versions (1): magento/module-inventory-source-selection-api

magento/inventory-composer-metapackage >=1.1.4 <1.2.0

Magento Open Source
2.3.7-p4, 2.3.7-p3, 2.3.7-p2, 2.3.7-p1, 2.3.7, 2.3.6-p1, 2.3.6, 2.3.5-p2, 2.3.5-p1, 2.3.5, 2.3.4-p2, 2.3.4-p1, 2.3.4
Adobe Commerce
2.3.7-p4, 2.3.7-p3, 2.3.7-p2, 2.3.7-p1, 2.3.7, 2.3.6-p1, 2.3.6, 2.3.5-p2, 2.3.5-p1, 2.3.5, 2.3.4-p2, 2.3.4-p1, 2.3.4
Patch file
patches/os/ACSD-45424_2.4.1.patch
  • vendor/magento/module-inventory-source-selection-api/Model/Algorithms/Result/GetDefaultSortedSourcesResult.php

Sources

Łukasz Bajsarowicz
Built by

Łukasz Bajsarowicz, e-commerce architect

Magento and Adobe Commerce architecture, upgrades, performance and audits for merchants and agencies since 2015; magento.watch is the tooling I use on those projects.

Open source, maintained on weekends.