magento / inventory

Magento Inventory Project (a.k.a MSI)
Open Software License 3.0
337 stars 248 forks source link

MSI and Posting a Shipment via API #2847

Open chadwixk opened 4 years ago

chadwixk commented 4 years ago

Preconditions (*)

Steps to reproduce (*)

Expected result (*)

Actual result (*)

sidolov commented 4 years ago

Hi @chadwixk could you please describe the case when you need such behavior? As for me, it's correct response according to the preconditions, since we have 0 on the stock there is nothing to ship, the product is physically absent.

chadwixk commented 4 years ago

@sidolov if you're posting a shipment via an API, there is some other external system involved and the user of that system has indicated the item has physically shipped. But Magento, despite having no knowledge of the physical world, says, "No, you can't ship this!"...but guess what, I already did ship it,nits on the UPS truck so let me post it! :)

If you are shipping from the Magento UI, I agree...mostly, that you can't ship more than you have.

But when posting shipments from another system, I'd say you no longer have the full picture, the other system is now the primary decision maker on if something shipped. And this process, of shipping, is not a virtual process, it happens in the physical world, which trumps the virtual world.

Also, physical inventory can get out of sync with Magento's inventory, that's life. If using the UI, you get an informative response (mostly..it would be nice if it told you exactly which item was short so you don't have to go open all the items on the order to find it) and you can just go update the product inventory and then, ship it. Or better yet, give a warning, but allow to override and make the stock go negative, because you don't really want a computer holding up your fulfilment operations and arguing with you that you don't have enough inventory to ship when you're staring at a box filled with product.

But even more so, if you are using another shipping system, out in the warehouse, and physically ship it .... then some detached process, that could be a batch process and happens hours later, tries to post the shipment...it gets rejected. And the API result is not even informative enough to know why. How is this scenario supposed to get resolved?

Despite it being a lot of unnecessary man power in the operation and programming in the shipping software, we couldn't even give a good answer why the shipment post failed so the user can fix it and then repost via the API.

But all of that is really unnecessary, because if someone is telling Magento that something got physically shipped, why should it disallow it?

sidolov commented 4 years ago

@chadwixk I got your point, you have a synchronization issue between Magento and external inventory system. We still cannot allow shipping orders in case of Qty = 0 because data will become inconsistent, but you may enable backorders with fixed product qty to avoid such issue. It will help you eliminate the synchronization gap and don't oversell much since backorders qty will be fixed. What do you think?

chadwixk commented 4 years ago

@sidolov that represents an issue from a customer service standpoint that is less than ideal as it opens up the possibility of allowing orders that cannot be shipped and disappointing the customer and inducing extra customer service time to resolve.

Also, if allowing this via the api causes data "will become inconsistent", isn't this also the case with the current situation? By allowing the api to update inventory but not allow it to post shipments, the data is already becoming inconsistent.

Also, there are issues when trying to use backorder qty with the inventory quantity update via the api as I posted here: https://github.com/magento/inventory/issues/2823

Further, there are issues with just turning MSI off in our scenario because Magento doesn't respect the "Decrease Stock When Order Is Placed" setting when MSI is off, per my other post here: https://github.com/magento/inventory/issues/2846

I know the intent of having the api is to enable larger organizations to use ERP systems, and other types of systems as well, to augment Magento base functionality. But I hope you can see with all 3 of these related issues I have posted about, there is a larger design issue in the fight between the API and internal Magento logic that is not making it easy to pair an ERP with Magento, which I am sure is not your goal.

It seems now, there is an "All or Nothing" approach. If the Decrease Stock when Order is Placed setting worked if MSI were off, I'd say that would be a start to help close a loophole in allowing a customer to place an order for inventory not available and in playing nicely with ERPs. Fixing the backorder issue I posted (#2823) would be a great second step and would result in a beautiful marriage of Magento and an ERP :)

DJB95 commented 3 years ago

@sidolov is there any update on this? I can relate and I'm dealing with the same kind of issue (Magento 2.4.1) with our Bol.com marketplace API (comparable to an Amazon marketplace API). @chadwixk have you tried setting "Backorders" to "Allow Qty Below 0" and "Out-of-Stock Threshold" to "0" ? I did this, but there seems to be a bug in Magento that causes this setting to not work. Curious if this works for you. Or does it not fit your requirements?

chadwixk commented 3 years ago

@sidolov @DJB95 unfortunately, these issues ended up being the straw that broke the camel's back and my client moved to Shopify. We've had no such issues on their platform. We don't currently support any other clients on Magento, so I haven't needed to try any other work arounds, etc on these issues.

That said, we will target Magento users for our software as well at some point and it would be good to know if these issues get fixed.

ub42a commented 3 years ago

Magento should not be dictating to it's users how they run their business, especially when there is no way for Magento to account for all of the various permutations of business processes out there. We're in the same boat - our ERP system is the "primary" controller of inventory and fulfillments and yet Magento (just 1 spoke of our sales channels which include 3P, B2B, etc) is unable to exist politely in this ecosystem. There is NO WAY to expect a real-time sync of sales and inventory between all of the moving parts so for Magento to flat out refuse to allow fulfillments to go through because it thinks its the owner of inventory is beyond moronic.

The current options are not enough. If you turn off Magento Stock then oversells go up dramatically. If you enable Backorders, same thing, prepare for oversells. If you use the system as is, you can't tell customers their order has been shipped. Who exactly at Magento thinks this is a workable system???

I am going to write database level triggers to jury-rig a fix since Magento obviously won't be fixing this correctly any time soon. For anyone not already entrenched with Magento you might want to consider other ecommerce platforms. This issue is just the latest in a pretty long line of close minded decisions on Magento's side. YMMV.