Magento2: Unable to set negative product's quantity

Created on 5 Apr 2017  路  16Comments  路  Source: magento/magento2

Hi all,
I'm trying to set a negative value to the product's quantity, but I can't save the product.

Preconditions

  1. Magento version 2.1.4
  2. Set config: Stores->Settings->Configuration->Catalog->Inventory->Stock Options->Display Out of Stock Products = Yes
  3. Set config: Stores->Settings->Configuration->Catalog->Inventory->Product Stock Options->Backorders = Allow *

Steps to reproduce

  1. Create or edit a simple product
  2. Set Quantity with a negative value (ex: -200)
  3. Save

Expected result

  1. Should allow to save the product

Actual result

  1. The form return an error message: "Please enter a valid number in this field".

Note

You can order (via Frontend) a quantity greater than that available; then try to edit the product (via Backend), but you can't save it with the negative quantity (see the attachment).

Thank you for your attention.

screenshot from 2017-04-05 12-25-30

Fixed in 2.1.x Fixed in 2.2.x Format is valid Ready for Work 2.1 bug report

Most helpful comment

We are working on this issue

All 16 comments

I have the same problem here in Magento version 2.1.5, today i'll try 2.1.6 in the hope the problem has been fixed

Ok. let us know, and please put a +1 at my post to get more visibility.

There are similar posts related to this topic but no solution yet:

Issue https://github.com/magento/magento2/issues/7197
and
Issue https://github.com/magento/magento2/issues/7540

I'm going to update now to 2.1.6. I will write the results here.

I have updated to 2.1.6 but the problem still exists.

Today i tried a fresh install but no luck.

I can confirm that this problem doesn't exists when 'Qty Uses Decimals' is set to Yes. Then a negative QTY is allowed. This could be a workaround but setting this to Yes allows a Qty of 1.25

image

Any updates on this problem?

We are working on this issue

We are unable to reproduce the issue in Magento 2.2. It seems to be fixed. However we are able to reproduce the issue in 2.1.5 and 2.1.6

@sadeeshmca Will there be a version 2.1.7 that fixes some issues present in 2.1.6 or is 2.1.6 te latest version in the 2.1 mainline?

I applied the commits to the files locally on my shop. These commits fixed the issue!

@DigiWorksNL thank you!
Magento 2 community member @sadeeshmca is working on this issue right now to deliver it into 2.1-develop branch. All fixes from 2.1-develop branch will be added to one of the nearest upcoming patch releases.

Thank you @sadeeshmca for working on this! You made some other people happier 馃憤

@sadeeshmca do you have any updates on Pull Request?

This issue is a duplicate of #7401
Internal ticket: MAGETWO-60599

Internal ticket to track issue progress: MAGETWO-69922

Fix will be released in 2.1.10.

Was this page helpful?
0 / 5 - 0 ratings