* Add Python 3.10 to test suite
* Support Django 4.2, remove Python 3.7 support and add Python 3.11 support
---------
Co-authored-by: Craig Weber <crgwbr@gmail.com>
Use entire queryset for offer report download rather than paginated one (#4105)
* Use entire queryset for offer report download rather than paginated queryset
* Add offer order report test
* Specify order number in create_order factory
* Fixes a potential redirect loop in ProductDetailView if URL includes certain characters
If the URL includes a colon ':' then the ProductDetailView is getting
trapped into a redirect loop.
* Added test to prove the point
---------
Co-authored-by: Martin Darmüntzel <martin@trivialanalog.de>
When there are product discountable true and variant discountable false in cart in the same time, discount is calculated for variant which is incorrect. (#4102)
* fix use get_is_discountable instead is_discountable attribute from product
* add test case
* add check discount percentage in test
* Fix test case
* remove file setting
* basket add product in test
* Make the test pass
---------
Co-authored-by: Kaew <ajchariya.ung@gmail.com>
If a product has a option it cannot be oversold (#4096)
* if a product has a option it cannot be oversold
* Improve error message
---------
Co-authored-by: wessel <wessel@highbiza.nl>
Co-authored-by: Lars van de Kerkhof <lars@permanentmarkers.nl>
* fix that a exclusive voucher is really exclusive
* add test
* consume offer 2 instead of 1
* fix that a exclusive voucher is really exclusive
* add test
* consume offer 2 instead of 1
* test 2.0
* Add proper test for multiple vouchers
---------
Co-authored-by: wessel <wessel@highbiza.nl>
* 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.