magento2-disable-stock-reservation icon indicating copy to clipboard operation
magento2-disable-stock-reservation copied to clipboard

The requested qty is not available (truncate inventory_reservation Table)

Open steveberrill opened this issue 4 years ago • 14 comments
trafficstars

Even though i installed this module to block writing to the inventory_reservation table. There were entries added before so they were still causing problems and was not able to order the sku products that still existed in this table

Would be good for the module to truncate this table when the module is installed/enabled.

steveberrill avatar Dec 22 '20 20:12 steveberrill

@kingberrill Great point!

I wonder whether it would be better to do this as a CLI command so that it could be run asynchronously from the setup:upgrade deployment. On databases with massive numbers of products/reservations it could increase the downtime on deployment. Something like php bin/magento ampersand:disable-stock-reservation:truncate-reservations or something like that.

I don't have capacity for this right now, but I've added some labels and will also add a note to the README.md to truncate that table after installing

convenient avatar Jan 05 '21 10:01 convenient

Hello @convenient

I wonder if you simply mean that the inventory_reservation should be truncated by running truncate table inventory_reservation; directly in the database or if it's something that should be done from the application?

Thanks.

maxacarvalho avatar Feb 02 '21 10:02 maxacarvalho

@maxacarvalho Directly in the database, sorry for lack of clarity.

convenient avatar Feb 02 '21 10:02 convenient

No problem @convenient, thank you very much.

maxacarvalho avatar Feb 02 '21 10:02 maxacarvalho

@maxacarvalho Also make sure to test everything locally, never do this kind of thing directly on prod without backups and testing first.

convenient avatar Feb 02 '21 11:02 convenient

Hi @convenient

Sure, it's being tested in our development environment at the moment. Thank you very much once again.

maxacarvalho avatar Feb 02 '21 11:02 maxacarvalho

@kingberrill Great point!

I wonder whether it would be better to do this as a CLI command so that it could be run asynchronously from the setup:upgrade deployment. On databases with massive numbers of products/reservations it could increase the downtime on deployment. Something like php bin/magento ampersand:disable-stock-reservation:truncate-reservations or something like that.

I don't have capacity for this right now, but I've added some labels and will also add a note to the README.md to truncate that table after installing

I implemented the solution on command, I hope I can help you https://github.com/AmpersandHQ/magento2-disable-stock-reservation/pull/49

the command looks like this bin/magento ampersand:disable-stock-reservation inventory-reservation has the possibility to add more tables

jamacio avatar May 14 '21 21:05 jamacio

Hey all, well.. Just stomped across here and tried the module. Upon installing it (magento 2.4.3-p2), I tried to run: bin/magento ampersand:disable-stock-reservation inventory-reservation

And found that the plugin is not being recognized properly, it does not belong to a namespace.. Should I directly go and truncate the table?

Regards

gentookid avatar Feb 01 '22 12:02 gentookid

@gentookid that was never merged i'm afraid, sorry.

Manually truncate the table please

convenient avatar Feb 01 '22 13:02 convenient

Correct, although I seem to be missing the inventory-reservation table, what I do have is: inventory_stock_1 inventory_stock_1.website_id
inventory_stock_1.is_salable inventory_stock_1.product_id inventory_stock_1.quantity inventory_stock_1.sku inventory_stock_1.stock_id

Could it be something differs in the schema from versions?

gentookid avatar Feb 01 '22 13:02 gentookid

The table is inventory_reservation

It should be there is you have the inventory tables installed

convenient avatar Feb 01 '22 14:02 convenient

@convenient there seems to be an issue when we order all available quantities for a specific item in a single order and then cancel that order from admin. Once we cancel, the stock Quantity is back to normal but the stock status is still the same as Out of Stock which as a result disappears the item from the frontend and does not let users add to the cart.

zeeshan2523806 avatar Apr 05 '22 22:04 zeeshan2523806

@zeeshan2523806 same issue. Any ideea, someone, on how to resolve this? If u set manually the product, from out_of_Stock and set the value in+stock, its returning the salable_qunatity to the initial value (the correct value). the problem is on 2.4.3.p1

bogdanignat avatar May 30 '22 08:05 bogdanignat

@zeeshan2523806 @bogdanignat

This is not an issue with this module, but rather the default behavior of Magento itself. Magento does not register how a product reached it's out of stock status (automatically when the stock falls below the out of stock threshold, or because the stock status attribute was changed) therefore Magento cannot (and does not) assume an increase in available qty means the product itself is back in stock.

If you want this to work you could look at the answer in this stack overflow post: https://magento.stackexchange.com/questions/320979/how-to-automatically-change-the-status-to-in-stock-if-products-are-added-to-the

RikvdHeijden avatar Jun 24 '22 07:06 RikvdHeijden

Hello peeps, is this still an issue? Thanks

tr33m4n avatar Feb 09 '24 21:02 tr33m4n