Oscar 3.1 release notes¶
- release:
2021-07-16
Compatibility¶
Oscar 3.1 is compatible with Django 2.2, Django 3.1 and Django 3.2 and Python versions 3.6 to 3.9.
Support for Django 3.0 has been dropped.
What’s new in Oscar 3.1?¶
Improvements have been made to the dashboard interface for creating and editing offers, vouchers, and voucher sets.
These better expose the flexible implementation of offer and voucher functionality, allowing:
creation of offers of all types
creation of vouchers with multiple offers
creation of voucher sets of all usages, and with multiple offers
Details of these changes can be found in the Changes to “dashboard.offers” and “dashboard.vouchers” apps section below.
Changes to dashboard.offers and dashboard.vouchers apps¶
The dashboard.offers and dashboard.vouchers apps have been reworked significantly. There have also been changes
to the related models, signals, and utility functions in the offer and voucher apps.
You should review these changes, especially if you have made customisations that depends on these apps, as some are backwards incompatible. The functional changes are summarised below.
The dashboard offer list view now displays all types of offer (previously voucher offers were hidden), with the ability to filter the list based on type.
The dashboard offer creation and update views now allow creation of offers of all types (previously only site-wide offers could be created). This exposes the full flexibility of Oscar’s offer types in the dashboard. Note that a new setting (
OSCAR_OFFERS_IMPLEMENTED_TYPES) has been added, which restricts the selectable types to ones that Oscar currently implements.The dashboard voucher creation and edit views have been signficiantly refactored. Previously, a conditional offer (and associated benefit/condition) was created automatically when creating a new voucher. This is no longer the case and instead the offers must be created separately in advance of assigning them to a voucher. These views now allow assigning multiple offers to a voucher, exposing the full flexibility of this app.
The create view for voucher sets has been changed to no longer create a conditional offer on the fly. As with vouchers, the offer has to be created separately before being assigned to the voucher set.
The logic for generating vouchers for voucher sets has been moved from the
savemethod of theVoucherSetinto the form logic for the dashboard form. This removes a potentially unsafe and unexpected generation of new vouchers when a voucher set is saved from outside the dashboard.offer.signalshas been renamed tooffer.receiversfor consistency with other apps.voucher.signals.delete_unused_related_conditional_offerhas been removed.voucher.utils.get_offer_namehas been removed, as voucher-type offers are no longer automatically created, updated, and deleted.
Removal of deprecated features¶
The
catalogue.Option.is_requiredproperty is removed. CheckOption.requiredinstead.The
oscar.apps.dashboard.catalogue.views.filter_productsutility function has been removed. Use the methods provided byPartnerProductFilterMixininstead.The
basket.AbstractLine.is_available_for_discountproperty is removed. Useis_available_for_offer_discount()instead.
Minor changes¶
AbstractProductAttributeValue.value_booleanhas changed from a deprecatedNullBooleanFieldto aBooleanField. This requires a database migration.A
refresh()method was added toProductAttributesContainerto allow refreshing attribute information from the database without reinitialising theProductobject.The deprecated
providing_argsargument has been removed from all of Oscar’s signals.oscar.apps.customer.alerts.utils.AlertsDispatcheris now imported dynamically to allow overriding.The utility functions in
oscar.apps.customer.historyfor reading to and writing from Oscar’s recently viewed products cookie have been refactored into a dynamically loadedCustomerHistoryManagerclass that projects can override.The dashboard catalogue search results now include products whose children match the searched parameters.
Dependency changes¶
Python package dependencies:
Upgraded
django-phonenumber-fieldto version 3.0.Upgraded
factory-boyto version 3.0.
Javascript and CSS dependencies:
Upgraded
bootstrapto version 4.6.0.Upgraded
jqueryto version 3.6.0.Upgraded
tinymceto version 5.7.