Skip to content
This repository has been archived by the owner on Apr 29, 2019. It is now read-only.

BUG REPORT Can not change stock status with product CSV product import #36

Open
piotrekkaminski opened this issue Nov 3, 2017 · 11 comments

Comments

@piotrekkaminski
Copy link
Contributor

From @SitionDenBosch on August 16, 2017 13:32

Preconditions

  1. Magento 2.1.5 and 2.1.7

Steps to reproduce

  1. Import some products
  2. Export products to CSV
  3. edit is_in_stock to 1 (or 0)
  4. import the CSV back into magento with is_in_stock edited

Expected result

  1. Stock status changes according to is_in_stock

Actual result

  1. It does not change stock status

I have tried this on 3 separate magento installs, does not work anywhere.

Best regards,
Thom

Copied from original issue: magento/magento2#10552

@piotrekkaminski
Copy link
Contributor Author

From @magento-engcom-team on September 13, 2017 10:35

@SitionDenBosch Thank you for your report. May you please check sequence of steps to reproduce your issue in description.

@piotrekkaminski
Copy link
Contributor Author

From @magento-engcom-team on September 27, 2017 22:0

@SitionDenBosch, thank you for your report.
We were not able to reproduce this issue by following the steps you provided. If you'd like to update it, please reopen the issue.

@piotrekkaminski
Copy link
Contributor Author

From @SitionDenBosch on October 13, 2017 9:56

I missed the 4th step to reproduce:

  1. import the CSV back into magento with is_in_stock edited.

This is basically all I do and I expect the stock status to update, but it does not

@piotrekkaminski
Copy link
Contributor Author

From @magento-engcom-team on October 13, 2017 10:41

@SitionDenBosch, thank you for your report.
We've created internal ticket(s) MAGETWO-81890 to track progress on the issue.

@piotrekkaminski
Copy link
Contributor Author

From @SitionDenBosch on October 13, 2017 11:6

@magento-engcom-team Thank you for acknowledging , will updates about the issue be reported back in this bug report, or should I follow the internal ticket somewhere?

@piotrekkaminski
Copy link
Contributor Author

From @ishakhsuvarov on October 13, 2017 14:14

@SitionDenBosch This issue will be closed once fix is released.

@piotrekkaminski
Copy link
Contributor Author

From @SitionDenBosch on November 1, 2017 10:29

@magento-engcom-team When the fix is released, is it possible to see the solution, so I can create my own patch to fix it?

@SitionDenBosch
Copy link

Hello,

Can someone give me insight into the fix once this issue has been solved? We need to solve this without updating Magento to the most recent version.

@TomashKhamlai
Copy link
Contributor

@dmanners I was able to reproduce this on 2.3.0-dev

@dmanners
Copy link
Contributor

The reason that this happens is because of https://github.com/magento-engcom/import-export-improvements/blob/2.3-develop/app/code/Magento/CatalogImportExport/Model/Import/Product.php#L2900 At this line no matter what is the value of "is_in_stock" if you do not also change the quantity you will get up in the stock processor.

This stock processor will will always return true unless the quantity is lower than the min quantity (and backorders are not allowed) or quantity is null.

https://github.com/magento-engcom/import-export-improvements/blob/2.3-develop/app/code/Magento/CatalogInventory/Model/StockStateProvider.php#L71

With that in mind I would suggest that a work around for the current status would be to not only set the is_in_stock column but also the qty column. This will then allow you to set the product as out of stock.

@dmanners
Copy link
Contributor

Or the other option would be to leave the qty but set allow_backorders = 1 and use_config_backorders = 0 while setting is_in_stock to 0.

Though neither are nice solutions they might help while we work on a solution for this problem.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants