-
Notifications
You must be signed in to change notification settings - Fork 248
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
Anyway to disable stock reservation? #2269
Anyway to disable stock reservation? #2269
Comments
MSI has dependencies on reservation code. I've added the following plugin override:
And added a new back end option Manage Reservations. Will this cause any other issues?? e.g. when the item is shipped for example? Have to add the variables again as they are private 👎 |
Generally we do not advise to disable reservations mechanism as it might cause undesired effects in multiple scenarios across the system. @asim-vax Scenario you are describing should work fine when you have |
We are using an external system that (by default) communicates the salable stock to Magento. I'm going to go ahead and assume that every Magento 1 webshop with an external inventory worked this way, since Magento 1 didn't have a reservation logic (and a wms / erp usually provides this functionality). Now both Magento 2 and the external system will have their own 'truth' about what the available stock level is. The reservation logic is great if no external systems are used, but if an external system is used that system should be the source of truth, not Magento. One solution could be to revert to the legacy inventory, but I don't really like working with things that are going to be legacy. Besides, there are a lot of great features in MSI that I do want to use. |
@ishakhsuvarov If you have say, 10 in stock, you want manage stock to be enabled as you only want to sell what you have and for magento to reduce the count. So you cannot turn off Manage stock even if you have an external system. |
I'm not talking about turning off 'Manage stock' but a simple decrease would suffice since we rely on an external system to actually 'compute' what we want to happen to the stock. If a refund is created, the external system will decide whether or not the item should be returned to stock. Take the following scenario;
Now we could argue that the external system should be pushing the quantity, not the salable quantity. But what if I have some other logic in my external system? Let's say a POS that can also reserve stock in my external system. Now my external system communicates a stock level of 2 while only 1 is available. Point being; My external system is the source of truth, not Magento. Magento is 'just' my storefront. Something which worked perfectly before MSI. (Not bashing on MSI, just stating the facts). |
Totally agree with @Swahjak. The logic reservation can be complex and it has to be handle by the erp. I have the same issue. I have two solutions. 1/ Provide a view of Magento reservations state to the erp. Thanks, |
hey guys @Swahjak @franckgarnier21 @craigcarnell , I totally agree with your business reasoning, and that for many merchants Magento is "just" a storefront while the real decision-making system is periodically sync-up with Magento providing the reliable data for transactional operations processing, being a source of truth. MSI was designed taking in mind all the possible integration strategies with 3rd party systems. That's why we introduced \Magento\InventorySalesApi\Api\PlaceReservationsForSalesEventInterface interface which is an entry point for all reservations created in Magento. You can look through the usage of the interface, it's called for Order Placement, Returns, Order cancellation, and Shipment handling both negative and positive (compensational) reservations will go through this entry point. The trickiest part for us is that we can't predict what particular integration set up for your case, as there could be different options which impact the Quantity calculation.
The question is what to do with an open reservation in Magento created as a result of order placement? Whether the order is already counted and Quantities are adjusted accordingly in the external system or not? You no need to switch off Manage Stock in Magento in this case, moreover doing so you will lose an explicit extension point provided exactly for this customization, but you need to add your behavior which will impact on how Reservations are created. For example, for MSI and MOM integration we will handle just the initial negative reservation created at the time of Order placement, all other reservations (on shipment and refund) are swallowed, as they are managed by MOM. The order placement reservation publishes a message to a Queue (in RabbitMQ) which is then handled by a subscriber on the MOM side. Thus, we always consider that Stock Quantities coming from MOM always include all the Orders placed in Magento. Here you can watch a presentation by @vadimjustus where he is describing different integration strategies with Magento + MSI based on TechDivision projects - https://www.youtube.com/watch?v=RoIEaoVm4mU |
Rather than disabling the reservation in favor of deduction I propose the following so that stock is reserved until the order hits the ERP system:
This solution has the benefit that orders that aren't yet synced still count towards the salable quantity. I'll be doing this for our implementation on Monday and will post the code once I'm done. |
We are experiencing the same issues for a project and need to remove the 'reservation' feature completely and allow 'saleable stock' to be the true source of inventory. Has anybody come up with a solution to this yet? |
You can play with the observers and plugin in order to remove the reservation additional. |
You can turn it off but disabling these modules and then running the usual setup:upgrade... etc.
|
@darrenbrooksnm thanks for the reply. This looks like ALL inventory management would be disabled? We still want to manage inventory so that 'saleable' stock is the same as 'quantity' so just do away with the reservation feature in M2. So if an item has a quantity of 10 then a maximum of 10 units can be purchased by a customer. |
@gavinhoman It does not, it disables the reservation feature along with a few other bits. It is almost like reverting back to pre2.3, do it on a test site and you will see. |
@asim-vax Hey, did you find any solution for that? We're facing the exactly same problem and we are desperate because of multiple stock issues. @gavinhoman What about you? Any solution on your side? Any help is very appreciated. |
@brngyn you might want to take a look at /**
* Class SourceDeductionService
*/
class SourceDeductionServicePlugin
{
/**
* @param \Magento\InventorySourceDeductionApi\Model\SourceDeductionServiceInterface $subject
* @param callable $proceed
* @param \Magento\InventorySourceDeductionApi\Model\SourceDeductionRequestInterface $sourceDeductionRequest
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function aroundExecute(
SourceDeductionServiceInterface $subject,
callable $proceed,
SourceDeductionRequestInterface $sourceDeductionRequest
): void {
// do nothing
}
} |
@brngyn we disabled all MSI modules for the time being, it was the only way we could get patch our live website same day to stop this causing more issues |
@franckgarnier21 Could you please explain how you managed to decrease the stock during the invoice instead of the shipment ? |
I would like to know too. |
@TheFrakes I know right? it boggles my mind that there's not way to manage the reserved stock in any way. |
Is there any word from Magento on this? It's a pretty drastic change from previous typical inventory integrations. To add to the commend from @Swahjak, the way for the "proper" inventory implementation would have to be something like:
At this point both Magento and WMS have stock=2 and reserved=1, so the actual saleable quantity is 1. Imagine now stock is sold somewhere else:
This means the inventory solution will also need to send updates to Magento for stock reserved elsewhere, as well as its status (shipped, cancelled, refunded). It does feel like Magento is trying to do too much with Stock, and act as a WMS, when really it should just be "told" what stock it can sell or not and prevent oversells, like it used to. |
We're running into situation A described in the video by Vadimjustus. We have another system which is the source of truth. I can really see the added value of the multi inventory module, since we have multiple stocks in multiple databases. But right now I have to disable MSI altogether because of our situation. |
@micwallace did you implement the code for the solution you proposed? |
Sorry I haven't got there yet. "Next week" never came haha. I will most likely be implementing it by the end of the year though. I will post code here once completed.
…On 18 November 2019 6:18:37 pm AEDT, Deepika Janiyani ***@***.***> wrote:
@micwallace did you implement the code for the solution you proposed?
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#2269 (comment)
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
We had similar issues recently and have implemented our own work around. We don't save any reservations to the db and reduce the source qty as soon as an order is invoiced. It isn't a one size fits all solution and I am sure there are caveats but it has worked well for our use case so far. https://github.com/8WireDigital/magento2-module-noreservations |
We also had a crack at this at Ampersand and dev'd a module to disable stock reservations: https://github.com/AmpersandHQ/magento2-disable-stock-reservation/ The main difference with @andrewkett's version is that we decrement stock on order placement, rather than invoice, because some payment methods have an in between state before invoices are created (payment_review) and if there's delays in the payment gateway, that might cause stock to oversell. The module will force source selection at order placement, so that we know where stock needs to be picked from, and the correct source stock is decremented on order placement. We also started the implementation to return stock in case of cancellations, however this needs to be updated to return stock to the correct source - at the moment it only works with single source inventory, but we plan on implementing this soon (see AmpersandHQ/magento2-disable-stock-reservation#4) |
I am not sure if this is good design, What if we use Double-entry bookkeeping approach on this issue and add the same amount we have negative in the stock reservation table as a positiv amount in a separated stock location. -4 + 4 = 0 so the effect of the reservation would be zeroed out and the sellable quantity would be correct. Then we don't need to overwrite any core functionality. |
We just made some changes to our StockEasy ext. which does this:
Would this method work for you? I think this sidesteps your 2nd req, as the reservations system should still produce purchase limits until that external stock is updated. |
We have the same issue. Stock worked perfectly before reservations .. and is now leading to a lot of custom coding and uncertainty.
|
@seansan completely agree with your points, it's so frustrating that the maintainers are just shrugging and saying "nah it's fine". Take a look at our module for a starting point, it forces stock selection at order invoice rather than shipment, and strongly relies on an external system to do stock replenishment in case of returns. edit: link to the module: https://github.com/AmpersandHQ/magento2-disable-stock-reservation |
I am also using the ampersand/magento2-disable-stock-reservation module, since the magento devs don't feel like this is an issue. |
It should have been made an option
1. To turn on / off reservation
2. Or to select at which moment in time to allocate it to a source (reservations per source)
I want to elaborate a little more on this because there are many questions about this in the community. It is also witholding merchants from making the step to M2.
**Turn on / off reservation**
Ability to disable reservations completely
**When to allocate it to a source (reservations per source)**
Ability to keep reservations on. Which in essence can be a good thing (also for stock taking etc.) .... The essence here is that the allocation to a source needs to occur much much sooner in the process, maybe even during quote creation (cart) or order creation. Merchants sell from multiple sources and need to be able to show the delivery time (or source name or location) where they expect the product to be sold from.
In addition a reservation per source is necesary for backorder processes like cross docking and drop shipping.
The best solution would be to add full support for
I. reservations per source
II. reservations per source from the quote level onwards (so you can inform customers in time)
…On Thu, 4 Jun 2020 at 11:02, elburro1887 ***@***.***> wrote:
I am also using the ampersand/magento2-disable-stock-reservation module,
since the magento devs don't feel like this is an issue.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2269 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAE7I2YN2GIJPODE73AE45TRU5PKXANCNFSM4HOUU62Q>
.
|
Sorry missed that : Completely my point ... THis change is leading to tremendous impact now |
We installed, configured, themed, and developed a 2.3.5 instance. There is no indication of any index named cataloginventory_stock on the Index Management. Has anyone had any experience with overcoming this MSI problem on 2.3.5? Is the legacy inventory completely gone now with 2.3.5 and we have no solution? |
@alchats as far as I'm aware of you can actually completely disable MSI and just go with the legacy stock. To give you an idea, we run with the following modules as "replace" in the composer.json (and rely on the 'old' cataloginventory to manage the stock):
|
This might be a bit off-topic, but I think it's still relevant enough... What I've always found odd is that there is a single "switch" to either have Magento handle stock levels and product display logic, or do nothing at all with stock information: the Manage Stock switch. In fact, I think the name is misleading because managing the stock (i.e. increase/decrease quantities, etc) doesn't have anything to do with using stock information to decide if and how to display products. In the type of scenarios that we are discussing here it might be enough to be able to tell Magento "don't touch my stock levels, I'll take care of that; but still use the stock information to decide if a product should be displayed or is available to purchase". I think this split makes perfect sense and shouldn't create any conflicts or inconsistencies. Cheers |
We also have an integration to an ERP that provides "source of truth" inventory qty updates. To be clear, this means that qty recieved from that system already respects reservations for the orders we have sent it. Our solution is: Add a plugin that only allows "order_placed" events into the magento reservations table (this enables magento to continue to provide accurate saleable qty between erp qty updates).
Add function in your integration to clear the magento reservations table by sku whenever we update qty from the erp integration for that sku
Add observer to disable magento's need to stop shipment processing if qty is not deemed available (for the occasion when things are not in perfect sync)
|
@denniskopitz Thank you, this appears elegant and capable of handling our specific situation. Thank you so much for sharing!!!! Looking forward to attempting to deploy & test. |
Glad to help. Thanks for 👍
…On Tue, Jun 23, 2020, 12:01 PM regannoveske ***@***.***> wrote:
@denniskopitz <https://github.com/denniskopitz> Thank you, this appears
elegant and capable of handling our specific situation. Thank you so much
for sharing!!!! Looking forward to attempting to deploy & test.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2269 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAL64GP42ZFBEGCS4AJUNELRYDGV7ANCNFSM4HOUU62Q>
.
|
@denniskopitz I'd like to explore this further. Can you please message me through https://www.linkedin.com/in/reganreneeengmanbell/ Thanks! |
I've been pretty surprised by this approach by MSI - you've considered multiple scenarios, really? How then was your conclusion that everyone should work with reservations? We need multiple stock but without the two-versions-of-the-truth introduced by reservations. The Ampersand module looks like a way to save ourselves a lot of headaches! |
Hi rob. Ampersand has a not a complete solution in my opinion. One of the
strange problems is that the front end (or any other channel) does not know
where the sale is being made from.
The simplest msi solution should just offer multi stock. Much in the same
way as it was devised for M1 (where it was never completed)
…On Fri, 10 Jul 2020 at 15:01, Rob Egginton ***@***.***> wrote:
I've been pretty surprised by this approach by MSI - you've considered
multiple scenarios, really? How then was your conclusion that everyone
should work with reservations?
We need multiple stock but without the two-versions-of-the-truth
introduced by reservations. The Ampersand module looks like a way to save
ourselves a lot of headaches!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2269 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAE7I23KPHR6HUTRLY3NGG3R24GJLANCNFSM4HOUU62Q>
.
|
I think reservations should be handled on a case-by-case basis depending on the client's configuration. In our case, since our single POT is synchronized once daily, we need stock to be reserved/managed between synchronizations and wholly ignored for shipping fulfillment. Each use case may have it's own solution. For us however, the ampersand module is not a viable solution. We tested it, and for our use case it did not work. |
@regannoveske Did you find a solution? We have the same situation.. |
The whole Magento 2 reservation system is broken. We can not use this software anymore until the reservation system can be disabled. |
Hi my client is having the same issue as well. The 3rd party OMS syncs their version of Salable Qty to Magento's Qty every 5 minutes. Our current workaround is, when pushing OMS Salable Qty to Magento Qty, check to see if there is any Reserved Qty, if there is add to it first, and then update the Magento Qty. However the Magento Product API does not seem to have the get method for Reserved Qty on an SKU level. Any idea how i can get it? |
Hi there, I'm not sure this is still relevant but I wanted to say we disabled magento stock reservations using a module for few clients who wanted to handle their stock by themselves without magento trying to handle reservation and stock balance: https://github.com/AmpersandHQ/magento2-disable-stock-reservation It's working as expected for us but be sure to go through all your test cases. |
I find it crazy that this is still an issue for sellers in 2024. We're also having troubles with this and was hoping someone could provide me some insight as to what implications simply turning off "Manage Stock" entails? |
@MrPotatox You can find the Manage stock product option definition on this page https://docs.magento.com/user-guide/v2.3/catalog/inventory.html From my understanding, setting the Manage Stock option to "no" on any product will prevent magento from caring about that product stock and movements (i.e. it won't record reservations nor decrease stock when customer order the product). Having this option set to No, magento will simply check if product is flagged as In stock and has a quantity > 0 in order to display the product as inStock/OutOfStock Hope that helps |
This is not useful as we do care if there is 1 or 100 products to sell, something our stock control application will not be able to update if this setting is turned on. |
Thank you, this is the response I was expecting, and as @alchats says isn't suitable because we need the stock to decrement when an order is placed. |
It appears the Magento documentation was updated 2 months ago (whether this bit was added then or not I am unsure) but it clearly states "To use Magento Order Management or third-party services such as ERP, disable Manage Stock." And there is at least the option in the backend configuration to "Decrease Stock When Order is Placed" that appears disconnected from the Manage Stock option. For users with a single stock source/location like us, this may be the most straightforward answer. For everyone else that has multiple sources/locations I can't see a way around having at least some interaction with the Inventory Res. |
Just so you know, I had a project using multiple websites et stock sources. In that context, using the AmpersandHQ/magento2-disable-stock-reservation I pointed earlier in that thread did the trick nicely as well 😉 |
Works in 2.4.6 ? |
Works in 2.4.7. |
Summary (*)
We are noticing an issue where the default behaviour of MSI (no sources or stock set up) is that as an item is sold, it adds a record to inventory_reservation. And salable quantity is reduced.
We manage our stock in another system, and update the quantity field as orders come in. This is causing issues as suddenly the salable quantities are lowering, and never reset.
Is there a way to reset this salable quantity?
Is there a way to disable this in store -> config, or via config.php by disabling modules?
Examples (*)
As you can see here, some salable quantity is the same as quantity, but some are 0, and some are lower. As we manage stock elsewhere, and update magento, the quantity is the field we rely on. It should reduce by 1 as an order is placed, like prior default magento behaviour.
Proposed solution
A way to reset MSI, or to not fill the reservation table so our salable quantity is artificially lower than it should be.
The text was updated successfully, but these errors were encountered: