Skip to content

Commit 3023688

Browse files
committed
ACP2E-4142: Post-Patch ACP2E-4118: Stock Threshold Change in Admin Causes Negative Salable Quantities and Stock Status Mismatch
1 parent 519d2ef commit 3023688

File tree

2 files changed

+1
-31
lines changed

2 files changed

+1
-31
lines changed

app/code/Magento/CatalogInventory/Model/StockStateProvider.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,7 @@ public function __construct(
7676
*/
7777
public function verifyStock(StockItemInterface $stockItem)
7878
{
79-
if ((int) $stockItem->getQty() === 0 &&
80-
$stockItem->getManageStock() &&
81-
$stockItem->getBackorders() == StockItemInterface::BACKORDERS_NO
82-
) {
79+
if ($stockItem->getQty() === null && $stockItem->getManageStock()) {
8380
return false;
8481
}
8582
if ($stockItem->getBackorders() == StockItemInterface::BACKORDERS_NO

dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductStockTest.php

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -153,33 +153,6 @@ public function testStockState()
153153
$this->_model->importData();
154154
}
155155

156-
/**
157-
* Test that imported product stock status with backorders functionality enabled can be set to 'out of stock'.
158-
*
159-
* @magentoDbIsolation enabled
160-
*
161-
* @return void
162-
*/
163-
public function testImportWithBackordersEnabled(): void
164-
{
165-
$this->importFile('products_to_import_with_backorders_enabled_and_0_qty.csv');
166-
$product = $this->getProductBySku('simple_new');
167-
$this->assertFalse($product->getDataByKey('quantity_and_stock_status')['is_in_stock']);
168-
}
169-
170-
/**
171-
* Test that imported product stock status with stock quantity > 0 and backorders functionality disabled
172-
* can be set to 'out of stock'.
173-
*
174-
* @magentoDbIsolation enabled
175-
*/
176-
public function testImportWithBackordersDisabled(): void
177-
{
178-
$this->importFile('products_to_import_with_backorders_disabled_and_not_0_qty.csv');
179-
$product = $this->getProductBySku('simple_new');
180-
$this->assertFalse($product->getDataByKey('quantity_and_stock_status')['is_in_stock']);
181-
}
182-
183156
/**
184157
* Test that product stock status is updated after import
185158
*

0 commit comments

Comments
 (0)