Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Save stockrecord information in ordered items
Artur Smęt6b4a7ae464d3
diff --git a/saleor/order/models.py b/saleor/order/models.pyindex e849e01cba..038bc35537 100644--- a/saleor/order/models.py+++ b/saleor/order/models.py@@ -214,13 +214,16 @@ class DeliveryGroup(models.Model, ItemSet):for item_line in partition:product_variant = item_line.productprice = item_line.get_price_per_item()+ stock = product_variant.select_stockrecord()self.items.create(product=product_variant.product,quantity=item_line.get_quantity(),unit_price_net=price.net,product_name=smart_text(product_variant),product_sku=product_variant.sku,- unit_price_gross=price.gross)+ unit_price_gross=price.gross,+ stock=stock,+ stock_location=stock.location if stock else None)def update_delivery_cost(self):if self.order.is_shipping_required():