You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. ===========================================
  2. Oscar 0.8 release notes - UNDER DEVELOPMENT
  3. ===========================================
  4. Welcome to Oscar 0.8!
  5. Table of contents:
  6. .. contents::
  7. :local:
  8. :depth: 1
  9. .. _overview_of_0.8:
  10. Overview
  11. ========
  12. Oscar now has a demo site customised for the US!
  13. .. _compatibility_of_0.8:
  14. Compatibility
  15. =============
  16. Oscar 0.8 is compatible with Django 1.5-1.7.
  17. Support for Python 2.6 has been dropped; Oscar works with Python 2.7, 3.3
  18. and 3.4.
  19. .. _new_in_0.8:
  20. What's new in Oscar 0.8?
  21. ========================
  22. Customisation just got easier!
  23. ------------------------------
  24. * Oscar's views are now dynamically imported. This means that they can be
  25. overridden like most other classes in Oscar; overriding the related
  26. Application instance is not necessary any more.
  27. * A new management command, ``oscar_fork_app``, has been introduced to help
  28. with the all-to-common pattern of forking an Oscar app to override one of
  29. it's classes.
  30. * The documentation around :doc:`/topics/customisation` has been given an
  31. overhaul to incorporate the changes.
  32. US demo site
  33. ------------
  34. To help developers building sites for the US, a new example Oscar site has been
  35. included in the repo. This customises core Oscar to treat all prices as
  36. excluding tax and then calculate and apply taxes once the shipping address is
  37. known.
  38. See :ref:`us_site` for more information.
  39. Cleanup around shipping methods
  40. -------------------------------
  41. * The models of the shipping app now have abstract base classes, similar to
  42. the rest of Oscar.
  43. * The legacy ``ShippingMethod`` name of the interface of the shipping app has
  44. been removed. Inherit from ``shipping.base.Base`` for the class instead, and
  45. inherit from ``shipping.abstract_models.AbstractBase`` for model-based
  46. shipping methods.
  47. * ``oscar.apps.shipping.Scales`` has been renamed and moved to
  48. ``oscar.apps.shipping.scales.Scale``, and is now overridable.
  49. * ``WeightBand.upper_limit`` is now a ``DecimalField``, just like the other
  50. weight-related fields.
  51. * The Django admin interface for the ``WeightBased`` shipping method has been
  52. made slightly more useful. Contributions for a dedicated dashboard app are
  53. most welcome!
  54. .. _minor_changes_in_0.8:
  55. Minor changes
  56. -------------
  57. * The ``OSCAR_CURRENCY_LOCALE`` setting has been removed. The locale is now
  58. automatically determined from the current language. This ensures prices are
  59. always shown in the correct format when switching languages.
  60. * The login and registration view now redirects staff users to the dashboard
  61. after logging in. It also employs flash messages to welcome returning and
  62. newly registered users.
  63. * The basket middleware now assigns a ``basket_hash`` attribute to the
  64. ``request`` instance. This provides a hook for basket caching.
  65. * The tracking pixel now also reports the Oscar version in use. This was
  66. forgotten when adding tracking of the Python and Django version in 0.7.
  67. Total information collected now is the versions of Django, Python and Oscar.
  68. Bugfixes
  69. ~~~~~~~~
  70. .. _incompatible_changes_in_0.8:
  71. Backwards incompatible changes in 0.8
  72. =====================================
  73. * The ``shipping`` app saw a few renames; please see the section above.
  74. Basket line stockrecords
  75. ------------------------
  76. The basket line model got a reference to the stockrecord in Oscar 0.6. The
  77. basket middleware since then updated basket lines to have stockrecords if
  78. one was missing. If any lines are still missing a stockrecord, we'd expect them
  79. to be from from submitted baskets or from old, abandoned baskets.
  80. This updating of basket lines has been removed for 0.8 as it incurs additional
  81. database queries. Oscar 0.8 now also enforces the stockrecord by making it
  82. the ``stockrecord`` field of basket ``Line`` model no longer nullable.
  83. There is a migration that makes the appropriate schema change but, before that
  84. runs, you may need to clean up your ``basket_line`` table to ensure that all
  85. existing null values are replaced or removed.
  86. Here's a simple script you could run before upgrading which should ensure there
  87. are no nulls in your ``basket_line`` table:
  88. .. code-block:: python
  89. from oscar.apps.basket import models
  90. from oscar.apps.partner.strategy import Selector
  91. strategy = Selector().strategy()
  92. lines = models.Line.objects.filter(stockrecord__isnull=True):
  93. for line in lines:
  94. info = strategy.fetch_for_product(line.product)
  95. if line.stockrecord:
  96. line.stockrecord = info.stockrecord
  97. line.save()
  98. else:
  99. line.delete()
  100. .. _removal_of_deprecated_features:
  101. Migrations
  102. ~~~~~~~~~~
  103. * Shipping:
  104. - ``0007`` - Change ``WeightBand.upper_limit`` from ``FloatField`` to ``DecimalField``
  105. .. _deprecated_features:
  106. Removal of deprecated features
  107. ------------------------------
  108. These methods have been removed:
  109. * ``oscar.apps.catalogue.abstract_models.AbstractProduct.has_stockrecord``
  110. * ``oscar.apps.catalogue.abstract_models.AbstractProduct.stockrecord``
  111. * ``oscar.apps.catalogue.abstract_models.AbstractProduct.is_available_to_buy``
  112. * ``oscar.apps.catalogue.abstract_models.AbstractProduct.is_purchase_permitted``
  113. * ``oscar.apps.catalogue.views.get_product_base_queryset``