Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Show order notes for non-open orders too
akjanik814fc5cccbfe
diff --git a/saleor/order/models.py b/saleor/order/models.pyindex c676385c2a..959ad976e6 100644--- a/saleor/order/models.py+++ b/saleor/order/models.py@@ -163,6 +163,10 @@ class Order(models.Model, ItemSet):else OrderStatus.CLOSED)+ @property+ def is_open(self):+ return self.status == OrderStatus.OPEN+def get_status_display(self):"""Order status display text."""return dict(OrderStatus.CHOICES)[self.status]diff --git a/templates/order/details.html b/templates/order/details.htmlindex bea547c1a7..855ec1df0e 100644--- a/templates/order/details.html+++ b/templates/order/details.html@@ -62,7 +62,6 @@{% endif %}{% endif %}{% include "order/_ordered_items_table.html" %}- {% if order.status == 'open' %}{% if notes %}<h2 class="order-notes__header">{% trans "Notes" context "Order notes list" %}</h2>{% for note in notes %}@@ -87,6 +86,7 @@{% endif %}{% endfor %}{% endif %}+ {% if order.is_open %}<div class="order-notes"><form method="post" class="form-group">{% csrf_token %}diff --git a/tests/test_order.py b/tests/test_order.pyindex de4f6ca0e7..e97cdde340 100644--- a/tests/test_order.py+++ b/tests/test_order.py@@ -134,8 +134,9 @@ def test_view_connect_order_with_user_different_email(assert order.user is None-def test_add_order_to_note(order_with_lines_and_stock):+def test_add_note_to_order(order_with_lines_and_stock):order = order_with_lines_and_stock+ assert order.is_opennote = models.OrderNote(order=order, user=order.user)note_form = OrderNoteForm({'content': 'test_note'}, instance=note)note_form.is_valid()