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.
Ensure Oscar always displays timezone-aware datetimes
In a few cases, django.templatefilters.date was used to format a
datetime as string. This filters expects localtime, but was always
passed time in UTC.
Introduced a helper function that should be used instead of the template
filter.
This requires a formset for stockrecords instead of a single form (which
actually is easier to handle than the previous situation). We have to
pass the product_class through to the formset forms though which is
mildly tricky.
All code handling email addresses has been update to use a new function
normalise_email, to have one consistent way of handling email addresses.
This function lowercases the domain part of an email address if it can
find an @, so it works on partial addresses as well.
Fix bug when parent field is excluded from ProductForm
A check in ProductForm's __init__ caused an error when the parent field
is not present. It is reasonable to believe that this field would be
omitted for deployments that sell only canonical products. Hence, the
existence of the field is checked before altering it.
Filenames can easily get longer than 100 characters, and that causes
Django to fail hard (I think with a DatabaseError), because it's
currently not validated (see Django #11027)
This fix increases the character limit to 255 chars. Going much higer
can cause trouble with MySQL.
Fixes #625. Thanks for reporting go to @soloweb.
This commit provides two mechanisms for passing format information from
Django to JS.
1. An options object can be passed to the oscar.dashboard.init method
that provides default values for the formats. This is optional - the JS
itself has some hard-coded defaults.
2. Form elements can defined data attributes that specify format
information directly. This is implemented for the datetime inputs
within the offers dashboard.
null=True is only useful for a few edge cases where one wants to
separate between '' and None. If null=True was found, it was removed.
If blank=True was not set already, it was set instead. If default=None
was set, it was removed (defaulting to '').
I then grepped the source code for tests 'is None' and 'is not None',
and checked the instances where default=None was set.
Fixes #584
- Merged PartnerUpdate and PartnerUserList view for a better UX
- Created new ExistingUserForm to allow for updating user details
without changing password
- PartnerUserUpdateView now enforces user being associated to partner
- Added Undo link when unlinking user
- Enrich user details when creating in form instead of view
Details:
- Make translatable some captions in list.html
- Make translatable caption in order_list.html
- Make translatable fieldname in apps/offer/models
- Make translatable caption in range_list.html
- Make translatable values in column 'is_active'
- Make translatable caption in voucher_list.html
- Make clickable link in discount description
- Make translatable caption in voucher_detail.html
- Display full description for field 'Usage'
- Make translatable field 'Promotion type'
- Make translatable caption in review_list.html
- Set output format for value due local settings. Russians use a comma
(not a dot) to distinguish between the whole and the remainder.
Fixes #650
- Removed detail view
- Moved Create button to top
- Moved Reset filtering button next to Search button
- Added success messages to update and delete views