inventory
inventory copied to clipboard
Salable quantity issue: After deleting a product, its entry is still present in the inventory_reservation table.
Preconditions (*)
Tested on this versions:
- Magento 2.4.3-p1
- Magento 2.4.5-p1
Description (*)
When we placed order for any product than order_placed entry is being generated in inventory_reservation table. After that if we delete that product and create order shipment of that order than shipment is successfully generated. But we do not have the product now so the entry of order_placed in inventory_reservation table have to be delete automatic or by using inventory_cleanup_reservation cron but it is now deleting. So now if we create same sku product again and save it than we can see that salable quantity is lesser than the actual quantity we set into the product because same sku name is already stored as order_placed in inventory_reservation table, So it is counting minus in salable quantity in new product. This is causing a salable quantity issue.
Steps to reproduce (*)
- Create two simple products
- Order it both of these products
- Delete one product from the backend
- Create shipment for that order
- Open the database and check inventory_reservation table
Expected result (*)
- When we delete one product from the backend than the entry order_placed of that product will also have to be delete from the inventory_reservation table
- When the order_placed entry was removed from the inventory_reservation table and then if we create a new product with same sku than salable quantity have to set as the default quantity.
- As we can see here the salable quantity is same as per the quantity I have set here.
Actual result (*)
- After deleting one product, the order_placed entry in inventory_reservation table is still showing.
- If we create new product with same sku which we have deleted before than it is taking less salable quantity because the entry of order_placed of deleted product is still in inventory_reservation table
Hi @Varshal24. 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.