Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Improve displaying order status
Anna Siwik08c06ae85045
diff --git a/saleor/core/templatetags/status.py b/saleor/core/templatetags/status.pyindex d8f6eda795..167c8505a4 100644--- a/saleor/core/templatetags/status.py+++ b/saleor/core/templatetags/status.py@@ -11,8 +11,7 @@ register = Library()ERRORS = {PaymentStatus.ERROR, PaymentStatus.REJECTED}-SUCCESSES = {- OrderStatus.CLOSED, PaymentStatus.CONFIRMED, PaymentStatus.REFUNDED}+SUCCESSES = {PaymentStatus.CONFIRMED, PaymentStatus.REFUNDED}LABEL_DANGER = 'danger'diff --git a/saleor/dashboard/order/filters.py b/saleor/dashboard/order/filters.pyindex 426049ff16..b6acc8d84e 100644--- a/saleor/dashboard/order/filters.py+++ b/saleor/dashboard/order/filters.py@@ -14,7 +14,6 @@ from ..widgets import DateRangeWidget, PriceRangeWidgetSORT_BY_FIELDS = (('pk', 'pk'),- ('groups__status', 'status'),('payments__status', 'payment_status'),('user__email', 'email'),('created', 'created'),@@ -23,7 +22,6 @@ SORT_BY_FIELDS = (SORT_BY_FIELDS_LABELS = {'pk': pgettext_lazy('Order list sorting option', '#'),- 'status': pgettext_lazy('Order list sorting option', 'status'),'payments__status': pgettext_lazy('Order list sorting option', 'payment'),'user__email': pgettext_lazy('Order list sorting option', 'email'),'created': pgettext_lazy('Order list sorting option', 'created'),diff --git a/saleor/dashboard/order/views.py b/saleor/dashboard/order/views.pyindex 39beed2b5b..4c731313d6 100644--- a/saleor/dashboard/order/views.py+++ b/saleor/dashboard/order/views.py@@ -59,7 +59,7 @@ def order_details(request, order_pk):payment.status == PaymentStatus.PREAUTH andany([group.status != GroupStatus.CANCELLED- for group in order.groupsa.all()]))+ for group in order.groups.all()]))can_release = payment.status == PaymentStatus.PREAUTHcan_refund = payment.status == PaymentStatus.CONFIRMEDpreauthorized = payment.get_total_price()diff --git a/templates/dashboard/includes/_orders_table.html b/templates/dashboard/includes/_orders_table.htmlindex 6f658b6e31..be125e5a03 100644--- a/templates/dashboard/includes/_orders_table.html+++ b/templates/dashboard/includes/_orders_table.html@@ -8,42 +8,37 @@<thead><tr>{% get_sort_by_toggle 'pk' as toggle %}- <th class="wide {% if toggle.is_active %}active{% endif %}">+ <th class="{% if toggle.is_active %}active{% endif %}"><a href="{{ toggle.url }}"><svg data-src="{{ toggle.sorting_icon }}" />#</a></th>+ <th></th>{% get_sort_by_toggle 'email' as toggle %}- <th class="wide {% if toggle.is_active %}active{% endif %}">+ <th class="{% if toggle.is_active %}active{% endif %}"><a href="{{ toggle.url }}"><svg data-src="{{ toggle.sorting_icon }}" />{% trans "Customer" context "Orders table header" %}</a></th>{% get_sort_by_toggle 'created' as toggle %}- <th class="wide {% if toggle.is_active %}active{% endif %}">+ <th class="{% if toggle.is_active %}active{% endif %}"><a href="{{ toggle.url }}"><svg data-src="{{ toggle.sorting_icon }}" />{% trans "Placed on" context "Orders table header" %}</a></th>{% get_sort_by_toggle 'status' as toggle %}- <th class="wide {% if toggle.is_active %}active{% endif %}">- <a href="{{ toggle.url }}">- <svg data-src="{{ toggle.sorting_icon }}" />- {% trans "Order status" context "Orders table header" %}- </a>- </th>{% get_sort_by_toggle 'payment_status' as toggle %}- <th class="wide {% if toggle.is_active %}active{% endif %}">+ <th class="{% if toggle.is_active %}active{% endif %}"><a href="{{ toggle.url }}"><svg data-src="{{ toggle.sorting_icon }}" />{% trans "Payment status" context "Orders table header" %}</a></th>{% get_sort_by_toggle 'total' as toggle %}- <th class="wide {% if toggle.is_active %}active{% endif %}">+ <th class="{% if toggle.is_active %}active{% endif %}"><a href="{{ toggle.url }}"><svg data-src="{{ toggle.sorting_icon }}" />{% trans "Total" context "Orders table header" %}@@ -57,6 +52,9 @@<td>#{{ order.id }}</td>+ <td>+ {% render_status order.status order.get_status_display %}+ </td>{% trans "Guest" context "Anonymous user account value" as guest %}<td>{{ order.user|default:guest }}@@ -64,9 +62,6 @@<td>{{ order.created }}</td>- <td>- {% render_status order.status order.get_status_display %}- </td><td>{% render_status order.get_last_payment_status order.get_last_payment_status_display %}</td>