AmpersandHQ / magento2-disable-stock-reservation

This module disables the inventory reservation logic introduced as part of MSI in Magento 2.3.3
GNU Lesser General Public License v3.0
219 stars 63 forks source link

Order not getting processed #35

Closed deepikajaniyani closed 1 year ago

deepikajaniyani commented 4 years ago

We have installed this module in one of our projects which uses 3PL for updating inventory.

On the stage instance we faced issue, i.e. the order invoices were not getting generated, we thought it might be an environment issue and deployed this module on production.

However, on production the orders were not getting processed at all, error below. Error: Error creating order on Magento Site Msg: Shipment Document Validation Error(s):

The order does not allow a shipment to be created. You can't create a shipment without products.

We checked the issue and it seems to be a default Magento issue https://github.com/magento/magento2/issues/9762, but we didn’t got this issue on stage, also this issue is for Bundle and we don’t server bundle products.

Can you please recommend something on this?

convenient commented 4 years ago

Hello

I have not heard of this error.

This comment on that issue says

Similar to bundles...configurable items sort of have a similar issue. You can't post the order_item_id of the simple product, you have to post the order_item_id of it's parent, the configurable item. This also seems a bit off as its not truly what you are shipping

Does that sound related?

Did you deploy this module to production in isolation of other changes, or alongside other customisations?

This comment says they have a workaround but without further details of how you are triggering your shipment it is hard to say.

convenient commented 4 years ago

Possible duplicate of https://github.com/AmpersandHQ/magento2-disable-stock-reservation/issues/29

convenient commented 4 years ago

Yeah looking at the posts on that ticket and the previous issue.

  1. What kind of products in the order? configurable? simple?
  2. How are you triggering the shipment, via the API? Do you have an example request payload?
deepikajaniyani commented 4 years ago

Sorry I missed the notifications of the ticket.

We process only simple orders.

We are triggering the shipment via an API. Let me check for an example.

convenient commented 4 years ago

thanks @deepikajaniyani

If you can give me an idea of what the shipment request looks like I can try and capture it in a test

Currently the test does simple products and just ships the whole order by POST to V1/order/{$orderId}/ship

https://github.com/AmpersandHQ/magento2-disable-stock-reservation/blob/1bb78a3fb7cad829168e0f566be466ef784f900c/dev/tests/acceptance/CheckoutCest.php#L84-L86

deepikajaniyani commented 4 years ago

Thanks @convenient

I have asked the 3PL team for this, and I also tried this on local using swagger and was able to replicate the issue, I am debugging this on local further.

image

convenient commented 4 years ago

Thanks @deepikajaniyani that is weird, the endpoint is the same as the one in the tests :/

What exact version of magento are you running? I will trigger the tests against that.

deepikajaniyani commented 4 years ago

@convenient we are on Magento Enterprise 2.3.2-p2

convenient commented 4 years ago

@deepikajaniyani I am off for a few days but when I am back I will spin up an enterprise site to run our tests against and see what that pulls up.

deepikajaniyani commented 4 years ago

@convenient Sure, no problem. Take your time.

Meanwhile we are also checking this, it seems this actually fails at vendor\magento\module-sales\Model\ShipOrder.php because it is not able to generate shipment.

deepikajaniyani commented 4 years ago

@convenient We checked this further, it seems that after adding this module, we are not also able to generate the invoice from the API call, even when generating the invoice we are getting error "The invoice can't be created without products. Add products and try again."

So basically the invoice and shipment is not generated and hence when the validator tries to validate it gets failed.

convenient commented 4 years ago

Helloy @deepikajaniyani

I have tested this on enterprise 2.3.2-p2 with the following amendment to the test suite to also invoice the order

https://github.com/AmpersandHQ/magento2-disable-stock-reservation/blob/ef06afcfcd89e5d8cdce91f0c5c9f3f85b7e5c72/dev/tests/acceptance/CheckoutCest.php#L84-L87

It still goes green for me. Can you think of anything else that may be non-vanilla configuration in how the invoices are created? Or perhaps posting a body to the invoice endpoint?

convenient commented 1 year ago

Closing this as we continue to use shipments via rest api without issue https://github.com/AmpersandHQ/magento2-disable-stock-reservation/pull/110

This can be reopened if verified thanks