Skip to content

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

Fix creating and canceling fulfillments

Adam Janik4375e6c81ee1
diff --git a/saleor/graphql/order/mutations/fulfillments.py b/saleor/graphql/order/mutations/fulfillments.py
index b08cf55a98..38c0bcb711 100644
--- a/saleor/graphql/order/mutations/fulfillments.py
+++ b/saleor/graphql/order/mutations/fulfillments.py
@@ -14,7 +14,6 @@ from ..types import OrderLine
def 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 = 0
lines_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 here
models.FulfillmentLine.objects.bulk_create(fulfillment_lines)
order = instance.order
update_order_status(order)
diff --git a/saleor/graphql/order/types.py b/saleor/graphql/order/types.py
index 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.Fulfillment
exclude_fields = ['order']