Prevent the need for source selection when shipping via Admin #127
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Attempt to resolve #121
In that issue it is reported that if the products stock is all the way to 0 you cannot ship the order as you cannot select a source.
Conceptually, the source is already selected when the order is created so this entire screen of source selection before creating a shipment does not seem necessary to me. This screen is injected in two places
Ship button URL replacement
https://github.com/magento/inventory/blob/062205f54be17ad70aa341f63fd5037b61a4c7d8/InventoryShippingAdminUi/Block/Adminhtml/Order/View/ShipButton.php#L63-L77
This block is injected to swap out the url so that you go straight to source selection when you hit "ship". this is solved by removing the block.
Observer to force redirect when starting a new shipment
There is an observer on
controller_action_predispatch_adminhtml_order_shipment_new
which will force a redirect to the source selection screenhttps://github.com/magento/inventory/blob/062205f54be17ad70aa341f63fd5037b61a4c7d8/InventoryShippingAdminUi/Observer/NewShipmentLoadBefore.php#L86-L92
Disabling this observer allows you to go straight to the order ship page to create a shipment.
Before
Screen.Recording.2023-10-10.at.15.21.44.mov
Hitting "ship" takes you to the source selection screen, to either
After
Screen.Recording.2023-10-10.at.15.33.47.mov
Hitting "ship" takes you to the shipment screen
Checklist
./dev/README.md
for how to run tests)