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.
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
The previous UPC validation in ``ProductForm`` broke updating the
a product. I realised this while digging around to fix the broken
``StockRecord`` issue that broke the CI build.
The validation now uses Django's validation of ``unique`` fields
instead and works.
The ``StockRecord`` issue was related to creating a form in the
update view providing stock record data in POST with ``partner``
empty. I corrected that and added a test case for it.
Attempting to create a new product with a UPC that already exists
raises an ``IntegrityError`` instead of handling the ``ProductForm``
as an invalid form with an appropriate ``ValidationError``.
I fixed that by adding a ``clean_upc`` validation method to the
form by checking for an existing product by UPC. I am not sure if
that is the most efficient way to validate this. If there's a
better alternative, I am happy to change it...and learn something
:)
**Note:** I switched the functional tests in ``product_tests.py``
to use ``WebTest`` while I was at it.