Skip to content

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

Omit canceled fulfillments in order details

Anna Siwikc9da39558ef8
diff --git a/saleor/order/views.py b/saleor/order/views.py
index 22d91eb4b1..9475f72040 100644
--- a/saleor/order/views.py
+++ b/saleor/order/views.py
@@ -4,14 +4,13 @@ from django.conf import settings
from django.contrib import auth, messages
from django.contrib.auth.decorators import login_required
from django.db import transaction
-from django.db.models import F
from django.http import Http404, HttpResponseForbidden
from django.shortcuts import get_object_or_404, redirect
from django.template.response import TemplateResponse
from django.utils.translation import pgettext_lazy
from payments import PaymentStatus, RedirectNeeded
-from . import OrderStatus
+from . import FulfillmentStatus, OrderStatus
from ..account.forms import LoginForm
from ..account.models import User
from ..core.utils import get_client_ip
@@ -41,7 +40,8 @@ def details(request, token):
if note_form.is_valid():
note_form.save()
return redirect('order:details', token=order.token)
- fulfillments = order.fulfillments.all()
+ fulfillments = order.fulfillments.filter(
+ status=FulfillmentStatus.FULFILLED)
ctx.update({'fulfillments': fulfillments})
return TemplateResponse(request, 'order/details.html', ctx)
diff --git a/templates/order/_ordered_items_table.html b/templates/order/_ordered_items_table.html
index ccb551df71..bdbf51d20a 100644
--- a/templates/order/_ordered_items_table.html
+++ b/templates/order/_ordered_items_table.html
@@ -27,17 +27,17 @@
{% endif %}
<div class="table__header order-details__table-header d-none d-sm-block">
<div class="row">
- <div class="col-md-6">
+ <div class="col-md-8">
<small>
{% trans "Product" context "Order details column title" %}
</small>
</div>
- <div class="col-md-3 text-right">
+ <div class="col-md-2 text-right">
<small>
{% trans "Quantity" context "Order details column title" %}
</small>
</div>
- <div class="col-md-3 text-right">
+ <div class="col-md-2 text-right">
<small>
{% trans "Price" context "Order details column title" %}
</small>
@@ -48,7 +48,7 @@
{% for line in order %}
<div class="table__row order-details__product{% if forloop.last %} order-details__last-row{% endif %}">
<div class="row">
- <div class="col-md-6 col-9">
+ <div class="col-md-8">
<a class="link--clean" href="{% if line.product %}{{ line.product.get_absolute_url }}{% endif %}">
<img data-src="{% product_first_image line.product size="60x60" method="crop" %}"
data-srcset="{% product_first_image line.product size="60x60" method="crop" %} 1x, {% product_first_image line.product size="120x120" method="crop" %} 2x"
@@ -57,7 +57,7 @@
<span class="order-details__product__description">{{ line.product_name }}</span>
</a>
</div>
- <div class="col-md-6 col-3">
+ <div class="col-md-4">
<div class="row">
<div class="col-md-6 col-12">
<p class="float-right">x {{ line.quantity }}</p>