Skip to content

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

Hide print and cancel order options in draft

Anna Siwikfda131f3ace1
diff --git a/saleor/order/models.py b/saleor/order/models.py
index ee70f3bd77..5b7fcb1448 100644
--- a/saleor/order/models.py
+++ b/saleor/order/models.py
@@ -154,7 +154,7 @@ class Order(models.Model):
return self.status in statuses
def can_cancel(self):
- return self.status != OrderStatus.CANCELED
+ return self.status not in {OrderStatus.CANCELED, OrderStatus.DRAFT}
class OrderLine(models.Model):
diff --git a/templates/dashboard/order/detail.html b/templates/dashboard/order/detail.html
index 92dad4e936..b09974eacf 100644
--- a/templates/dashboard/order/detail.html
+++ b/templates/dashboard/order/detail.html
@@ -42,11 +42,13 @@
</li>
{% endif %}
{% endif %}
- <li>
- <a class="btn-print" href="#">
- {% trans "Print" context "Order detail action" %}
- </a>
- </li>
+ {% if not order.is_draft %}
+ <li>
+ <a class="btn-print" href="#">
+ {% trans "Print" context "Order detail action" %}
+ </a>
+ </li>
+ {% endif %}
</ul>
{% endblock %}