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

Inventory is not subtracted on placed order with enabled Manage Inventory #3240

Closed
chemicalkosek opened this issue Feb 10, 2023 · 3 comments
Closed
Assignees

Comments

@chemicalkosek
Copy link
Contributor

chemicalkosek commented Feb 10, 2023

Bug report

Describe the bug

When Manage Inventory is enabled, variant inventory is not subtracted when order is placed.
This was reported by user on Discord, I have tested and indeed the issue exists. I would consider this quite critical.
User also reported that returning an item does increase the inventory count.

System information

Medusa version (including plugins): 1.7.6 (happens on 1.7.5 too)
Node.js version: 18.14
Database: postgres

Expected behavior

Inventory is subtracted when order is placed.

@olivermrbl
Copy link
Contributor

olivermrbl commented Feb 12, 2023

This is likely due to carts being completed without using the cart-completion strategy, which contains the inventory adjustment step. E.g. if the OrderService.createFromCart is used directly, you will need tax lines creation, payment authorization, and inventory adjustment as preliminary steps.

I realise, the Stripe webhook endpoint does not currently handle this, so this might be the culprit to your issue. I've added it to our backlog and we will investigate and come up with a solution asap :)

@olivermrbl
Copy link
Contributor

@chemicalkosek Can I get you to confirm that this is only when orders are created through the Stripe webhook? We will solve the webhook issue in #3257, so I am closing this to avoid confusion around our inventory management functionality.

@chemicalkosek
Copy link
Contributor Author

Confirmed :) I saw the PR using cart completion strategy for webhook. Should definitely fix this.

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

2 participants