spree / spree_wombat

Connect your Spree Commerce storefront to Wombat
BSD 3-Clause "New" or "Revised" License
31 stars 53 forks source link

Make shipment serializer build its items from inventory units #20

Closed athal7 closed 10 years ago

athal7 commented 10 years ago

Currently shipments build their items from the line items, not the inventory units. For normal shipments that does not pose a problem, however, for exchange shipments (https://github.com/spree/spree/pull/5073), where a new inventory unit is generated for the original line item (but a new variant), the original item's sku would end up being included in the shipment payload, which is incorrect.

The information sent in the shipment record ends up being mostly the same, with the difference being that until inventory_units have a quantity on them (coming soon https://github.com/spree/spree/issues/5091) items will be flattened.

athal7 commented 10 years ago

For me there are 2 test failures, that seem to fail on master as well

JDutil commented 10 years ago

This only needs to be done to master after https://github.com/spree/spree/pull/5073 right?

athal7 commented 10 years ago

@JDutil correct, though it could be merged in master beforehand with no negative consequences

athal7 commented 10 years ago

it only has a dependency on this method https://github.com/spree/spree/blob/master/core/app/models/spree/inventory_unit.rb#L75, which was added in https://github.com/spree/spree/commit/5cf68e252977fb4dae237701d6b3ee8f8a8d7c55