Fixes stockrecord availability validation message in the case when stock is lower than allocation. Previously the message that appeared contained negative numbers. For example: "a maximum of -1 can be bought". Now it will display: "no stock available"
The test suite brings it's own stock record model for testing. Django
1.7 requires that we only import models from apps in INSTALLED_APPS, so
we need to use it to avoid clashes.
This completes the move away from partner wrappers to strategies. All
the methods for determining price and availability information have now
been removed from the partner classes.
The helper policy class ("DelegateToStockRecord") have been removed too
as they no longer have methods to call on the stockrecord.
To support multi-currency sites. This commit also made the order totals
a mandatory input for creating an order, which meant quite a few tests
had to change to support the new API.
This is to support US-like sites where sales taxes are only known once
the customer enters their shipping address.
This requires several changes to templates to show prices exclusive of
tax when tax isn't known.
Offers are currently now applied until taxes are known as it is unclear
to me whether to use the tax-exclusive prices to determine whether
customer's meet value conditions. This may change later.
Add two selector methods to get partner's addresses
Introduced get_primary_address and get_address_for_stockrecord. I opted
to implement rudimentary logic supporting only one PartnerAddress
instead of raising NotImplemented. I'm assuming that given the demand
for multiple partners scenario, it is more likely than not that a user
will need to store an address for a partner.
This allows updating code in both places, if necessary. Getting Django
1.5 support would be painful otherwise. This also removes the circular
dependency of django-oscar-testsupport on Oscar.
The requirements were merged. The imports were updated
accordingly. Unused imports in the touched files were removed. No
further changes.
* Fixes bug with prefetch_related where looking up secondary relations
raises a DoesNotExist exception.
* Reworks cached partner map to use PKs instead of names.
Availability logic from product class is looked up in product obj
rather than in wrapper to avoid unnecessary queries.