spree/spree — pull request #3067 by huoxito (2013-05-22 18:27:49+00:00)
Title: Do not build packages for missing items

When building shipment packages Spree assumed that every order item had
an existing stock item in all stock locations. But that may not always
be the case since the `propagate_all_variants` config was added to
StockLocation in #3050

I think we should move forward with this. Spree should be smart enough
to figure out which order items exist in which stock locations.
Honestly I don't like the implementation of this fix but it was the only
one I could come up with for now.

This issue was brought in #3051. So we need to figure out it first to
only then merge that PR.

Another possible fix for this would be to add a `stock_location.build_packages(order)` method. That may be a lot cleaner and easier to understand imo. I just didn't go for that *yet* because I'm still confused by the current implementation and I think many pieces would have to move.