* history should use settings.SESSION_COOKIE_SAMESITE directions
* Optimize product attributes
* Cache attribute lookups
* simplify QuerysetCache
* Perform bulk update for product attributes
* Added tests for uncovered features.
* added 1 more test
* fixes test
* Added more tests
* multi_option can not be save in bulk
* it should be possible to skip validate_identifier because it will be very hard to import data with oscarapi if this is always required.
* misnamed test
* fixes test
* added test for attribte validation errors
* added test that validates that required attributes are not valid
* more tests
Return True in is_tax_known() when the basket is empty (#4166)
* Fix AbstractBasket's is_tax_known() to handle an empty basket
* Fix lint errors
* Added another test for is_tax_known
* Improved clarity of complex expression
[FEAT] Absolute discount benefit applied on each product (#4168)
* feat :star: add benefit of fixed discount per product
* feat :star: check range and value in absolute product discount benefit form
* test :ballot_box_with_check: add tests for the new product level absolute discount benefit
* fix :wrench: resolve lint errors
* refactor :package: rename FIXED_PRODUCT to FIXED_UNIT
* refactor :package: rename AbsoluteProductDiscountBenefit to FixedUnitDiscountBenefit
* refactor :package: rename fixed unit benefit test file
* fix :wrench: clean fixed unit benefit form
* refactor :package: rename Fixed unit to Fixed
* feat :star: apply discount on all the product items
* refactor :package: rename test class names to FixedUnit
* fix :wrench: update tests for fixed unit benefit
Only change order line status when status is available (#3948)
* Only change order line status when status is available
It's possible for lines to have a completely different status than the order.
When a line is at an "end status" where it cannot change anymore this will result in the line being changed to something you might not want.
* line status test
* 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>
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>
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`