* feat :star: optimize range products reordering
* test :white_check_mark: add test to verify range product reordering
* fix :wrench: remove local settings from test settings
* test :white_check_mark: update product reordering test
Avoid unexpected behaviour when saving modified child attributes. (#4007)
This fixes the issue where modifying child properties would have no effect in
the dashboard, if the parent would have the same property. This is not directly
obvious in the dashboard context. Allowing child attributes to be saved if they
are directly modified even if they are the same, avoid confusion.
Make sure to only save attributes when they have been changed. (#3995)
* Make sure to only save attributes when they have been saved.
This makes sure attributes on the parent are not needlessly saved to the child.
* Renamed testcase
* Added tests for child product attributes not copying parent attributes
* Make ProductAttributesContainer even more lazy and initialize only when an attribute is being read.
* Changed docstring
There are small typos in:
- docs/source/releases/v0.5.rst
- docs/source/releases/v3.2.rst
- src/oscar/apps/offer/queryset.py
- tests/integration/basket/test_models.py
Fixes:
- Should read `threshold` rather than `treshold`.
- Should read `overridden` rather than `overidden`.
- Should read `category` rather than `catagory`.
- Should read `applications` rather than `appliations`.
Signed-off-by: Tim Gates <tim.gates@iress.com>
Signed-off-by: Tim Gates <tim.gates@iress.com>
* Implemented predefined product options
* css
* added missing migration in the test app
* Added tests
* added test
* added test
* Added more testz
* Added validation
* Renamed add_optional_choice to add_empty_choice
* added release notes
* Added help_text help text.
yup
* Use a JSONField for the option value
* removed pylint
* fix display of multi and checkbox in basket and order (#13)
* fix display of multi and checkbox in basket and order
Co-authored-by: willeke huizing <38961397+willekeh@users.noreply.github.com>
Similarly to `base_fields` and `hash_fields` it will be easier to
override fields for the search text.
Without this change to add/remove fields from search text we need to
override the `_update_search_text` method.
Improve efficiency of Range.product_queryset when fetching matching child products (#3734)
* Improve efficiency of Range.product_queryset when fetching matching child products.
* Add tests to verify that contains_product returns true for child products whose parent is in a range.
Make fixes for deprecations in Django 3.2 and Python
- Add new "DEFAULT_AUTO_FIELD" Django 3.2 setting
- Fix deprecated (in "gettext") use of non-int numbers for selecting
plural translations
- Provide "get_response" callable when creating middleware-factory
instance in tests
Fix saving of Benefit/Condition "proxy_class" field in dashboard OfferWizardStepView
- This uses a simpler and more robust way to get the list of fields to
serialise for storage in the session
- "custom_benefit" and "custom_condition" were unused, as they aren't
fields of any of the serialised models
- Also remove unused parameter in
"dashboard.offers.views.OfferWizardStepView._fetch_form_kwargs"
- allow creation of offers of all types
- allow creation of vouchers with multiple offers
- allow creation of voucher sets of all usages, and with multiple offers
Issue: https://github.com/django-oscar/django-oscar/issues/3162
* Checking of `offer.benefit.max_affected_items` removed from the
`available` method of `LineOfferConsumer` class - available items should
not be limited by related benefit (it should be considered when applying
the offer).
* Improved `apply` method of `PercentageDiscountBenefit` - affected
items must include "quantities with discount applied".
* `is_satisfied` method of `CountCondition` updated to pass `offer`
instead of `None` to `line.quantity_without_offer_discount` - this
change is required to fix the initial issue.
* Updated `test_available_with_offer` test - initially this test was
added to check the lines that we removed from the `available` method of
`LineOfferConsumer` class (See fda27a183d/).
* Added tests to confirm that the initial issue is fixed.
Fix rendering of upsell messages for exclusive offers (#3548)
* Improve `available` method of `LineOfferConsumer` class
* Add `quantity_available_for_offer` method to `AbstractLine` class
* Improve conditions: "Get num matches" methods updated to use `quantity_available_for_offer`
method of `Line` model.
* Improve conditions: `get_upsell_message` methods updated to show upsell message only in
the cases where `delta` > 0.
* Ensure basket upsell messages are not `None`
Use function as the return value of `get_url_decorator`. This change
needed because `get_url_decorator` method of `OscarConfigMixin` class
returns function or `None` and not string.