* 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>
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