Oscar 1.6 release notes¶
- release:
2018-05-23
Welcome to Oscar 1.6
Table of contents:
Compatibility¶
Oscar 1.6 is compatible with Django 1.11 and Django 2.0 as well as Python 2.7, 3.4, 3.5 and 3.6.
Official support for Django 1.8, 1.9 and 1.10 has been dropped.
What’s new in Oscar 1.6?¶
Added support for managing large amounts of vouchers grouped in sets.
Removal of deprecated features¶
oscar.core.phonenumber.PhoneNumberis removed. Usephonenumber_field.phonenumber.PhoneNumberinstead.Removed the redundant
OSCAR_PROMOTION_MERCHANDISING_BLOCK_TYPESsetting.
Minor changes¶
The majority of the Oscar class imports now use dynamic loading, instead of direct imports, for better extensibility and customisability.
Added the ability to specify a custom class loader through the
OSCAR_DYNAMIC_CLASS_LOADERsetting.Customer transaction emails were reworked to use Mailgun templates, so that they have a more modern appearance.
SearchHandler.get_search_formmethod now accepts additional keyword arguments, which will be passed on search form class instance.Added
get_stock_infohook tooscar.apps.basket.models.Basketfor implementing strategies that depend on product options.Fixed the page create/update views in the dashboard to correctly validate URLs. Invalid characters in URLs will raise a validation error, as will URLs longer than 100 characters.
The default shipping method (
oscar.apps.basket.views.BasketView.get_default_shipping_address) on the basket summary page now uses the user’s default shipping address to calculate an indicative shipping cost.Fixed
ExtendedURLValidatorfor locale-prefixed URLs for locales, different from current (see #1481). Previously, validation did not pass when if the current locale wasen-gband, the a visited URL was/de/catalogue/and visa versa due to Django’s default behaviour.
- Product attribute value save is now handled by separate methods, to make it
easier to override this behaviour.
Address hash generation is now separated from the summary in order to preserve same behaviour when summary property customised (see #1537). They can use different field names, listed out in base_fields and hash_fields respectively. Also hash generation now became platform-independent and generates the same for Python 2 and 3. Corresponding data migration will update hashes automatically. Take it into account that it will take time to run if you have large user base.
Compact basket form is no longer displayed for the products with options on product list pages since it caused form elements to impose inside the product box (see :issues:`1976`).
Added
has_optionsproperty to theoscar.apps.catalogue.models.Productmodel to indicate whether an instance or its product class has product options.
oscar.core.validators.validate_passwordwas removed. Usedjango.contrib.auth.password_validation.validate_passwordinstead.
oscar.core.validators.CommonPasswordValidatorwas removed. Usedjango.contrib.auth.password_validation.CommonPasswordValidatorinstead.User notifications are marked as read only when viewed in detail, instead of being marked as read in bulk when the notification list was viewed.
Oscar’s
ImageInput,TimePickerInput,DatePickerInputandDateTimePickerInputall use templates for rendering.It is now possible to manage images for variant products and their parents.
For variant products we now display their own images on product detail page and fallback to parent product images if they don’t have any.
Basket line form quantity field now has “max” attribute with the maximum allowed quantity in it based on product availability and basket threshold (see #1412).
An unused setting
OSCAR_SETTINGSwas removed fromoscar.core.defaults.Fixed ``PhoneNumberMixin``s handling of empty phone number fields in forms.
Backwards incompatible changes in Oscar 1.6¶
Fixed a regression introduced in Oscar 1.5 (see #2664) where
StockRequired.availability_policywas dependent on the product having a price. Price and availability are now decoupled, and it is possible to defer determination of a price until a product is added to the basket.
oscar.apps.customer.auth_backends.EmailBackendnow rejects inactive users (whereUser.is_activeisFalse).
EmailBackendno longer enforces its own password strength validation, and relies instead on theAUTH_PASSWORD_VALIDATORSsetting used by Django.
oscar.apps.basket.middleware.BasketMiddlewarewas rewritten as new-style middleware for Django 1.11.
oscar.apps.offer.models.ConditionalOffernow has a new flagexclusiveto denote that the offer involved can not be combined on the same item on the same basket line with another offer. This flag is used byoscar.apps.basket.utils.LineOfferConsumer, a facade that supersedes the oldoscar.apps.basket.models.Line._affected_itemscounter, and replaces it with a more fine-grained approach. This makes it possible to apply two distinct non-exclusive offers on the same line items, for example multiple distinct vouchers. A couple of methods on theLinemodel have been extended with an optionalofferargument, i.e.discountandconsume, so if you are using a customisedLinemodel, you have to update your methods’ signatures.Invalid URL names supplied to the
OSCAR_DASHBOARD_NAVIGATIONsetting are now logged as an exception (previously they were silently ignored). The offending menu item will be skipped during menu rendering. In Oscar 1.8 the exception will be raised without being intercepted.All signals are now loaded directly rather than using dynamic imports.
Stock manipulation (allocation/consumption/cancellation) now only happens if the
track_stockproperty of the product’s class is set to true.
oscar.forms.widgets.RemoteSelectwas updated to work with version 4 of select2. Instead of rendering a hidden input it now renders a normalselectelement.The
django-extra-viewsdependency was upgraded to version 0.11, and the basket views that rely onextra_views.ModelFormSetViewupdated to use the new factory_kwargs attribute.jQuery UI was removed from Oscar’s static files. Projects that require it should install it at the project level.
Compatibility for Internet Explorer version 9 an lower was dropped from Oscar’s templates and styles.
The Google Analytics tracking code provided by Oscar now uses
gtag.jsAPI instead of the deprecatedanalytics.js. Analytics are also disabled by default in Oscar’s dashboard.
Dependency changes¶
Upgraded
jqueryto version 3.3.1.Upgraded
bootstrapto version 3.3.7.Upgraded
bootstrap-datetimepickerto v2.4.4.Upgraded
jquery-mousewheelto v3.1.13.Upgraded
inputmaskto v3.2.7.Upgraded
jquery-sortableto v0.9.13.Upgraded
select2to v4.0.5.
Deprecated features¶
The following features have been deprecated in this release:
StockRecord.price_excl_taxwill be renamed intoStockRecord.pricein Oscar 2.0. Please see #1962 for more details.The
StockRecord.price_retailandStockRecord.cost_pricefields are deprecated and will be removed in Oscar 2.0.The
order.Line.est_dispatch_date,order.Line.line_price_incl_tax,order.Line.unit_retail_price,order.Line.unit_cost_priceandorder.Line.line_price_excl_taxfields are deprecated and will be removed in Oscar 2.0.oscar.views.decorators.staff_member_requiredis deprecated. Useoscar.views.decorators.permissions_required(['is_staff'])instead.Support for Django 1.8, 1.9 and 1.10 has been dropped in line with the Django project recommendation for third party apps.