Affects Version/s: Release Branch 16.11, Release Branch 18.12, Release Branch 17.12, Trunk
Fix Version/s: None
We came across this issue recently and also have fixed the same.
After creating a sales order and approving it, we created a shipment and receive all the items and change the status to Packed.
Moving to the sales order edit screen. We are able to update the Ship Group Destination Address or Shipment Method. Even without changing anything if we simply click the update button, Inventory re-reservation service is being called and getting re-reserved. Since there are no records in the OrderItemShipGrpInvRes Entity, the inventory values are getting re-reserved again and this is a major issue.
For a Sales Order of quantity 10, after approving and creating a shipment, we issue 10 items and change status to packed. Now we go to the Order View/Edit Screen and update the shipment method/Address or simply click the update button and the quantity in the Shipment for that order changes to 20 which should not happen.
The fix we made is passing a hidden variable from the shipping Info Section and when clicking the update button, we pass that value to the Inventory Re-reservation event and check the value in that method.
In the loadCartForUpdate method in OrderService.java, we pass the checkValue to see whether this request is coming from the Shipping Information update section and prevent the cancelOrderInventoryReservation service from calling.
In the saveUpdatedCartToOrder method in OrderService.java using the same checkValue, we prevent the reserveInventory service from calling.
This occurs when an existing shipment is in packed status for an order and that order's shipping information needs to be edited.
This was an issue in our case and we fixed this way.
If it is ok we will provide the patch here?.