Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/staff/templates/staff/analysisorder_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h5 class="text-2xl my-5">Samples to analyze</h5>
<a class="btn bg-yellow-200" href="{% url 'staff:order-analysis-list' %}"><i class="fas fa-arrow-left"></i> back</a>
<a class="btn bg-primary" href="{% url 'staff:order-analysis-samples' pk=object.id %}">Samples</a>
<a class="btn bg-primary" href="{% url 'staff:order-add-staff' pk=object.id %}">Assign staff</a>
{% if object.status == object.OrderStatus.DELIVERED %}
{% if object.status != object.OrderStatus.DRAFT%}
<div class="ml-auto"></div>
{% url 'staff:order-to-draft' pk=object.id as to_draft_url %}
{% action-button action=to_draft_url class="bg-secondary text-white" submit_text="Convert to draft" csrf_token=csrf_token %}
Expand Down
9 changes: 5 additions & 4 deletions src/staff/templates/staff/extractionorder_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,16 @@ <h5 class="text-2xl my-5">Delivered Samples</h5>
<a class="btn bg-primary" href="{% url 'staff:order-extraction-samples' pk=object.id %}">Samples</a>
<a class="btn bg-primary" href="{% url 'staff:order-add-staff' pk=object.id %}">Assign staff</a>

<div class="ml-auto"></div>
{% if object.status == object.OrderStatus.DELIVERED %}
<div class="ml-auto"></div>
{% url 'staff:order-manually-checked' pk=object.id as confirm_check_url %}
{% url 'staff:order-to-draft' pk=object.id as to_draft_url %}

{% action-button action=confirm_check_url class="bg-secondary text-white" submit_text="Confirm - Order checked" csrf_token=csrf_token %}
{% action-button action=to_draft_url class="bg-secondary text-white" submit_text="Convert to draft" csrf_token=csrf_token %}
{% endif %}

{% if object.status != object.OrderStatus.DRAFT %}
{% url 'staff:order-to-draft' pk=object.id as to_draft_url %}
{% action-button action=to_draft_url class="bg-secondary text-white" submit_text="Convert to draft" csrf_token=csrf_token %}
{% endif %}

{% if object.next_status %}
{% url 'staff:order-to-next-status' pk=object.id as to_next_status_url %}
Expand Down
2 changes: 1 addition & 1 deletion src/staff/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ class OrderToDraftActionView(SingleObjectMixin, ActionView):
model = Order

def get_queryset(self) -> models.QuerySet[Order]:
return super().get_queryset().filter(status=Order.OrderStatus.DELIVERED)
return super().get_queryset()

def post(self, request: HttpRequest, *args, **kwargs) -> HttpResponse:
self.object: Order = self.get_object()
Expand Down