Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Merge branch 'master' of github.com:mirumee/saleor into SALEOR-2645-recalculate-draft-order-total

Damian W1592409febf2
diff --cc CHANGELOG.md
index ef2e353f8f,b960afce19..42ba37299c
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -36,9 -36,11 +36,13 @@@ All notable, unreleased changes to thi
- Fix invalid tax rates for lines - #7058 by @IKarbowiak
- Allow seeing unconfirmed orders - #7072 by @IKarbowiak
- Raise GraphQLError when too big integer value is provided - #7076 by @IKarbowiak
+- Recalculate draft order when product/variant was deleted - #7085 by @d-wysocki
+- Added validation for `DraftOrderCreate` with negative quantity line - #7085 by @d-wysocki
+ - Remove html tags from product description_plaintext - #7094 by @d-wysocki
- Performance upgrade on orders query with shipping and billing addresses - #7083 by @tomaszszymanski129
+ - Fix dataloader for fetching checkout info - #7084 by @IKarbowiak
+ - Update also draft order line total price after getting the unit price from plugin - #7080 by @IKarbowiak
+ - Fix failing product tasks when instances are removed - #7092 by @IKarbowiak
### Breaking
- Multichannel MVP: Multicurrency - #6242 by @fowczarek @d-wysocki
diff --cc saleor/order/tests/test_order.py
index 9b4e62f2ac,fd500418f9..1647b417ab
--- a/saleor/order/tests/test_order.py
+++ b/saleor/order/tests/test_order.py
@@@ -96,8 -95,33 +96,33 @@@ def test_add_variant_to_draft_order_add
assert line.product_name == str(variant.product)
+ def test_add_variant_to_draft_order_adds_line_for_new_variant_with_tax(
+ order_with_lines, product, product_translation_fr, settings
+ ):
+ order = order_with_lines
+ variant = product.variants.get()
+ lines_before = order.lines.count()
+ settings.LANGUAGE_CODE = "fr"
+ price = TaxedMoney(net=Money(8, "USD"), gross=Money(10, "USD"))
+ manager = Mock(
+ calculate_order_line_unit=Mock(return_value=price),
+ get_order_line_tax_rate=Mock(return_value=0.25),
+ )
+ add_variant_to_draft_order(order, variant, 1, manager)
+
+ line = order.lines.last()
+ assert order.lines.count() == lines_before + 1
+ assert line.product_sku == variant.sku
+ assert line.quantity == 1
+ assert line.unit_price == price
+ assert line.total_price == price
+ assert line.translated_product_name == str(variant.product.translated)
+ assert line.variant_name == str(variant)
+ assert line.product_name == str(variant.product)
+
+
def test_add_variant_to_draft_order_adds_line_for_variant_with_price_0(
- order_with_lines, product, product_translation_fr, settings
+ order_with_lines, product, product_translation_fr, settings, info
):
order = order_with_lines
variant = product.variants.get()