Previously, the test suite ran with a custom user model for Django >=
1.5, but it didn't subclass Oscar's AbstractUser. This commit adjusts
the custom user model to subclass Oscar's so we can test functionality
within the custom user class.
This does require a change to the way tests authenticate as we don't
actually use the username field.
This should greatly increase usability of the dashboard product update
page when managing a large amount of products.
Fixes #618
Conflicts:
oscar/apps/dashboard/catalogue/forms.py
oscar/apps/dashboard/catalogue/views.py
oscar/static/oscar/js/oscar/dashboard.js
oscar/views/generic.py
Widgets for product selection using select2 and ajax
To be more consistent with how access to products is handled in the
permission based dashboard, access to orders is now more permissive. As
long as one order line's partner has the current user in it's users,
access is granted.
Prior to this change, it was possible to select child products in the
product dashboard. A new function get_parent_products_queryset was
introduced, analogues to the existing get_related_products_queryset. It
is not based on the BrowsableManager as I can envision scenarios where
that is extended to respect status fields or such like, which we should
ignore when selecting a parent field. Otherwise it wouldn't be possible
to e.g. add a few hidden products with child products.
Two issues in tests with the G library were fixed as well, were
unintentionally child products were created. If the product field is
left unspecified, it seems to pick a product instead of leaving it as
None.
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.
Drop fine-grain control with Django's default permissions
I've changed my mind on this and think we should KISS. So the support
for the catalogue.*_product permissions has been dropped from the stock
dashboard. Clear case of feature creep, and it's easily added if needed.
Effective permissions are unchanged apart from catalogue views, which now
also allow users that have both partner.dashboard_access and
catalogue.change_product as permissions.
Includes tests.
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.
Product updates in the dashboard weren't being saved. This was a
regression introduced by my refactoring of the ProductUpdate/Create
views.
A test to ensure that a product title does indeed get updated has been
added.
Reported and fix supplied by @soloweb in #613. Thank you.
Following guidance from Tangent's UX team (blame them!)
* Split 'metadata' step into 'name and description' and 'restrictions'
* Add progress bar
* Add summary of entered data in right-hand sidebar
* Clean up breadcrumbs and URLs
Still needs from FED love.
* Re-skin of the dashboard home page.
* Ensure the graph on the home page dashboard shows only 12 segments on the x-axis and not 24.
* Add auto refresh of 5mins to dashboard index
Fixes 366