spree/spree — pull request #3339 by huoxito (2013-07-08 20:01:06+00:00)
Title: Recreate shipments in frontend when necessary

Every time a customer gets to the point where shipments were created,
delivery step, and then decides to go back and change some item quantity
or add a new product we need to recreate the shipments so they properly
reflect the current order state.

I initially tried to apply these changes on the spree_core level but it
turns out to be really difficult because while both backend and frontend
use the same API in backend inventory units are created as soon as items
are included on the order. On the other hand in frontend inventory units
are only created when customers reaches the delivery step

I think it fixes the issue described in #3244, at least on the frontend component. I'm not sure where exactly I should add the code in the spree api component to fix it there as well but I can investigate it next.

Also I thought about redirecting users to the delivery step after running `create_proposed_shipments` so that we can be sure they would view the shipments updated. But I believe that could get pretty annoying and I think most users would still follow the usual checkout flow instead of going right back to payment or confirm checkout steps.

In case it looks right 2-0-stable needs this fix as well.