tangentlabs/django-oscar — pull request #766 by maikhoepfel (2013-07-28 11:52:52+00:00)
Title: Add support for partner addresses

When dealing with US sales tax, you need to know the address of the warehouse where something is shipped from. I propose we extend Oscar to support partner addresses to handle this. Then you can traverse from a stock record to the appropriate address for that record.

In theory, a partner could have lots of addresses so this change will require:

- a new `PartnerAddress` model that has a FK to the partner
- a selector function on the partner `get_address_for_stockrecord` which takes a stockrecord and returns the appropriate address. Often stock records will contain a warehouse code and so this method would map this code to the appropriate address. The default implementation should probably be to raise `NotImplemented`.

So, the API would look something like this:
```python
for line in basket.all_lines():
record = line.product.stockrecord # this will be line.stockrecord in 0.6
address = record.partner.get_address_for_stockrecord(record)
...
```

This change will also require additional sections of the dashboard that allow partner addresses to be managed.