Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Credit Memo > Return To Stock > Items stay out of stock #3387

Open
codebase-md opened this issue Jun 1, 2023 · 1 comment
Open

Credit Memo > Return To Stock > Items stay out of stock #3387

codebase-md opened this issue Jun 1, 2023 · 1 comment

Comments

@codebase-md
Copy link

codebase-md commented Jun 1, 2023

Preconditions (*)

  1. Magento 2.4.5-p2 with Inventory version 1.2.3
  2. No backorders or else
  3. Manage stock enabled

Steps to reproduce (*)

  1. Buy the maximum amount possible of a product so it gets status out of stock
  2. Complete the order handling process until order status is complete
  3. Create a credit memo for the whole amount > tick "Return To Stock"

Expected result (*)

  1. Product should change stock status to "in stock" after quantity is added back and saleable quantity is calculated

Actual result (*)

  1. Product stays out of stock

Additional Info

I debugged this process and traced it back to following code:
SourceDeductionService

I don't understand the semantics here. Why is the current status(in other words old status) of the legacy stock item relevant if the actual stock status is already calculated. Additionally stock status of legacy stock item is not updated at this point. That follows later via plugin and relies on the stock status of the source item which in turn relies on the stock status of the legacy stock item before it gets updated.

This is particularly annoying since it produces additional work. After every refund (of the described kind) I have to change stock status manually. This also bears the risk that I forget to do that. Product stays out of stock, catalog becomes smaller and smaller.(just a worse case scenario)

@m2-assistant
Copy link

m2-assistant bot commented Jun 1, 2023

Hi @codebase-md. Thank you for your report.
To speed up processing of this issue, make sure that you provided sufficient information.
Add a comment to assign the issue: @magento I am working on this


Join Magento Community Engineering Slack and ask your questions in #github channel.

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

No branches or pull requests

1 participant