Sylius/Sylius — pull request #2151 by waaghals (2014-11-21 14:20:52+00:00)
Title: [WIP] Multi warehouse

| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | yes
| Deprecations? | no
| Fixed tickets | #1144
| License | MIT
| Doc PR | n/a

# Changes
A `Variant` now has multiple `StockItem`s. A `StockItem` describes inventory levels for a certain `Variant` within a `StockLocation` (Warehouse).
This model is based on Spree's and thus has the same names for consistency. ERD for current domain model.
![ERD](http://i.imgur.com/tBCg0Kd.jpg)
The inventory page in the backend has been modified so it doesn't have nested tables anymore.
This was done because the overview became crowded when inventory per location was added.

Currently it looks like this:

| Product | Options | Name | OnHand | OnHold |
| ----------------- |:-------------:| ---------------------:| -----------:| ----------:|
|Product nr. 1 | Size: L | Warehouse nr .1 | 5 | 0 |
| | | Warehouse nr .2 | 10 | 2 |
| | Size: XL | Warehouse nr .1 | 5 | 0 |
| | | Warehouse nr .2 | 7 | 3 |
|Product nr. 2 | Color: R | Warehouse nr .1 | 5 | 0 |
| | | Warehouse nr .2 | 10 | 2 |
| | Color: Y | Warehouse nr .1 | 5 | 0 |
| | | Warehouse nr .2 | 7 | 3 |

# TODO
- [ ] Create multiple shipments based on the smallest amount of packages
- - [ ] Fix order creation in the frontend
- [ ] Fix the specs as they have not been updated yet
- [ ] Submit changes to the documentation
- [ ] Document the BC breaks
- [ ] Finish the feature
- [ ] Gather feedback for my changes
- [ ] Squash commits