Oscar 3.2 release notes¶
- release:
2022-23-12
Compatibility¶
Oscar 3.2 is compatible with Django 3.1 and Django 3.2 and Python versions 3.7 to 3.9.
Support for Django 2.2 has been dropped. Support for Python 3.6 has been dropped.
What’s new in Oscar 3.2?¶
oscar.order.mixins.EventHandlerMixinwas created for easily using the EventHandler without manually create the handler every time.- Added more product option types:
Select
Radio
Multi select
Checkbox
Wishlists are now shareable, inside your account you can make your wishlist private(default), public or shared. Public wishlists are available for everyone, shared wishlists only for the emails the user allowed access to.
Backwards incompatible changes¶
The interface for the OPTION_FIELD_FACTORIES has changed and now receives the form, the product and the option. Update your overrides as required.
The
valuefield on theBasketLineAttributeandOrderLineAttributemodels is a JSONField now. If you have overridden thedescriptionproperty on theBasketLineandOrderLinemodels, you’ll need to change this to make sure options/multi options are displayed normally in the basket and order.The wishlist create and update view now inherits from a new mixin that shares functionality. If you’ve overrides on those views, you should check to see if everything works as intended.
Removal of deprecated features¶
url_has_allowed_host_and_schemeis no longer present inoscar.core.compatand should be directly imported asdjango.utils.http.url_has_allowed_host_and_scheme
Minor changes¶
Added a new helper
core.utils.is_ajaxwhich replicates the logic of Django’sHttpRequest.is_ajaxmethod that was deprecated in Django 3.1.Persisted
OrderFactory.date_placedto the database when set, instead of just setting it on the object without saving it.Fixed getting non public categories with
get_categoriesby only returning browsable categories.Reviews can now only be viewed and placed when the product is public.
The title has been removed by default from all address forms in Oscar. The database field is still present, and projects that wish to retain this field in their forms should add it back by overriding the fields property of the Meta class for applicable forms.
Changed
PartnerProductFilterMixinqueryset to also include child products for the partner user.Changed
RangeDetailViewto respect theOSCAR_PRODUCTS_PER_PAGEsetting for pagination.Fixed the output of the
OfferReportGeneratorand generated it’s data more efficiently.Avoid
KeyErrorinBulkEditMixinif objects matching filters no longer exist.Changed the order of
check_skip_conditionsandcheck_pre_conditions.Made it easier to pass custom arguments to order processing
EventHandler.Fixed the handling of
InvalidPageexceptions inCatalogueView.Added
search_fieldstoAbstractAddressmodel.Added a uniqueness constraint across
codeandproduct_classfor theProductAttributemodel to prevent duplicate attribute codes. This comes with a migration that will remove duplicate codes before applying the unique constraint migration.Implemented a more efficient approach for range queries. This will make (for example) multiple offers in your site a lot faster.
Made the attribute codes unique per product class
Changed the review form to as_stars filter instead of if statements
Prevent unnecessary database query in UseFirstStockRecord strategy
Fix the issue where html5 validation errors were not shown in the dashboard.
Changed the stock to be consumed and allocated in an atomic state.
Fixed not requiring a range when choosing a custom condition
Changed the basket to be readonly in the django-admin
The request is now passed to all the communication event type messages, so emails can be sent from the correct site in case of a multisite project.
Added basket post data back to the form when invalid
Dependency changes¶
Python package dependencies:
Upgraded
django-treebeardto version >=4.3.0Upgraded
django-phonenumber-fieldto version >=4.0.0,<7.0.0Upgraded
django-extra-viewsto version >=0.13,<0.15
Javascript and CSS dependencies:
Upgraded
@fortawesome/fontawesome-freeto version 6.1.1.Upgraded
bootstrapto version 4.6.1.Upgraded
inputmaskto version 5.0.7.Upgraded
tinymceto version 6.0.3.Upgraded
eslintto version 8.16.0.Upgraded
nanto version 2.16.0.Upgraded
sassto version 1.52.1.Upgraded
tempusdominus-bootstrap-4to version 5.39.2.
Deprecated features¶
The
annotate_form_fieldtemplate tag is deprecated. It’s functionality of annotating form fields with their widget type is now built in to Django.In the ORDER_PLACED email templates, the variable
status_urlshould not be used anymore. Please usestatus_pathin conjunction with theabsolute_urltemplate tag instead. It will be removed in a future version of Oscar.