magento / magento/inventory

Magento Out-of-Stock Threshold setting to 0

Open
#3,195 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Progress: dev in progress Progress: ready for grooming
Dominant language
PHP
Stars
357
Forks
262
PR merge metrics
No merged PRs in 30d

Description

There is some confusion on the design of the setting Out-of-Stock Threshold (related to backorders) especially around this setting having the value of zero. Backorders are enabled. There are 3 references to this setting and the value of zero.

Our assumption is that the 1st statement below should always be true when backorders are enabled. If the Out-of-Stock Threshold reaches 0 or is 0 or was set as 0. Then this means: the threshold was reached, there is no more stock.

However it seems two processes are being mixed into 1 setting. If the Out-of-Stock Threshold "reaches" 0 then Magento sets the product to out of stock (thus by order of the customer), but when the admin sets the value to 0 then in this case this means one can sell into infinity. This is a design flaw and hereby a bug. It needs to be fixed or crucial processes cannot continue.

References to the bug/issue

1. Here the value of the setting Out-of-Stock Threshold is explained especially for 0 values.

The text in the manual is "When the Salable Quantity reaches 0, the product is displayed as Out of Stock in the storefront."

![image](https://user-images.githubusercontent.com/652395/86125771-7d3e6000-badd-11ea-8e39-eb17dc54fe23.png)

2. Here the entry of the zero (0) value is explained. We assume the data needs to be entered in the admin? and dont know if this relates to API updates and stock imports too?

The text in the manual is "With Backorders enabled, entering 0 allows for infinite backorders."

![image](https://user-images.githubusercontent.com/652395/86125536-2042aa00-badd-11ea-8a79-81a1546d4394.png)

3. In addition one could assume that this formula is NOT correct. It depends on how? the data is entered!

![image](https://user-images.githubusercontent.com/652395/86125707-6435af00-badd-11ea-9bbf-043be3282f17.png)

### Preconditions and Steps to reproduce(*)
1. Enable backorders
2. Set Out-of-Stock Threshold to -2
3. Buy 1 and then 1 more products
4. Product goes out of stock
5. Buy 1 more product not possible
This is OK

Compare to

1. Enable backorders
2. Set Out-of-Stock Threshold to 0
3. Buy 1 and then 1 more products
4. Product does not go out of stock
5. Buy 1 more product is possible!
This is NOK

Compare to

1. Enable backorders
2. Set Out-of-Stock Threshold to 0 and MSI STOCK = 2
3. Buy 1 and then 1 more products
4. Product does not go out of stock
5. Buy 1 more product is possible!
This is NOK

### Expected result (*)
1. Out-of-Stock Threshold set to 0 should *ALWAYS* result to 0 stock from backorders

It should not be used to hide some extra exceptional situation. 0 = 0

### Actual result (*)
1. In case 2 and 3 you end up with infinite sales

- [ X] Severity: **S2** _- Affects non-critical data or functionality and forces users to employ a workaround._

![image](https://user-images.githubusercontent.com/652395/86125530-1caf2300-badd-11ea-9a83-202b22c0bd0a.png)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the reported backorder scenarios with an Out-of-Stock Threshold of -2 and 0, including MSI stock of 2, and compare the resulting salable quantity and storefront availability. Review the inventory backorder and threshold behavior to determine the intended meaning of zero; done means the documented and observed behavior agree and the zero-threshold case no longer permits unintended sales.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.