Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Fix creating and canceling fulfillments
Adam Janik4375e6c81ee1
diff --git a/saleor/graphql/order/mutations/fulfillments.py b/saleor/graphql/order/mutations/fulfillments.pyindex b08cf55a98..38c0bcb711 100644--- a/saleor/graphql/order/mutations/fulfillments.py+++ b/saleor/graphql/order/mutations/fulfillments.py@@ -14,7 +14,6 @@ from ..types import OrderLinedef clean_lines_quantities(order_lines, quantities):errors = []- import ipdb; ipdb.set_trace()for order_line, quantity in zip(order_lines, quantities):if quantity > order_line.quantity_unfulfilled:msg = npgettext_lazy(@@ -95,6 +94,7 @@ class FulfillmentCreate(ModelMutation):order_lines = cleaned_input.get('order_lines')quantities = cleaned_input.get('quantities')if order_lines and quantities:+ super().save(info, instance, cleaned_input)quantity_fulfilled = 0lines_to_fulfill = [(order_line, quantity) for order_line, quantity@@ -109,7 +109,6 @@ class FulfillmentCreate(ModelMutation):order_line=line[0],fulfillment=instance,quantity=line[1]) for line in lines_to_fulfill]- # FIXME: Something is wrong heremodels.FulfillmentLine.objects.bulk_create(fulfillment_lines)order = instance.orderupdate_order_status(order)diff --git a/saleor/graphql/order/types.py b/saleor/graphql/order/types.pyindex cdb05fbefc..25a254feb6 100644--- a/saleor/graphql/order/types.py+++ b/saleor/graphql/order/types.py@@ -86,6 +86,7 @@ class Fulfillment(DjangoObjectType):class Meta:description = 'Represents order fulfillment.'+ interfaces = [relay.Node]model = models.Fulfillmentexclude_fields = ['order']