Skip to content

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

Save product_name in OrderItem as variant.product_display

Mira Szewczykc999cba0292f
diff --git a/saleor/order/models.py b/saleor/order/models.py
index dc8f7ebf74..70066f813b 100644
--- a/saleor/order/models.py
+++ b/saleor/order/models.py
@@ -262,7 +262,7 @@ class DeliveryGroup(models.Model, ItemSet):
product=product_variant.product,
quantity=quantity,
unit_price_net=price.net,
- product_name=smart_text(product_variant),
+ product_name=product_variant.display_product(),
product_sku=product_variant.sku,
unit_price_gross=price.gross,
stock=stock,
diff --git a/saleor/product/models/base.py b/saleor/product/models/base.py
index c5bdaea4b0..00fcff4d27 100644
--- a/saleor/product/models/base.py
+++ b/saleor/product/models/base.py
@@ -267,9 +267,9 @@ class ProductVariant(models.Model, Item):
else:
return smart_text(self.sku)
- def display_product(self, attributes=None):
+ def display_product(self):
return '%s (%s)' % (smart_text(self.product),
- self.display_variant(attributes=attributes))
+ smart_text(self))
def get_first_image(self):
return self.product.get_first_image()