From d90edab59f0c6e3bf18d0ba2d5c436fa4c65b454 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Thu, 30 Jul 2020 20:23:46 +1000 Subject: [PATCH] Staff users are allowed to delete stock items that otherwise are not able to be deleted --- InvenTree/stock/templates/stock/item_base.html | 2 +- InvenTree/stock/templates/stock/item_delete.html | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/InvenTree/stock/templates/stock/item_base.html b/InvenTree/stock/templates/stock/item_base.html index 63804291ec..a35b5f0346 100644 --- a/InvenTree/stock/templates/stock/item_base.html +++ b/InvenTree/stock/templates/stock/item_base.html @@ -115,7 +115,7 @@ InvenTree | {% trans "Stock Item" %} - {{ item }} {% endif %}
  • {% trans "Duplicate stock item" %}
  • {% trans "Edit stock item" %}
  • - {% if item.can_delete %} + {% if item.can_delete or user.is_staff %}
  • {% trans "Delete stock item" %}
  • {% endif %} diff --git a/InvenTree/stock/templates/stock/item_delete.html b/InvenTree/stock/templates/stock/item_delete.html index 9e908a0d67..09d9397ecc 100644 --- a/InvenTree/stock/templates/stock/item_delete.html +++ b/InvenTree/stock/templates/stock/item_delete.html @@ -1,11 +1,14 @@ {% extends "modal_delete_form.html" %} +{% load i18n %} +{% load inventree_extras %} + {% block pre_form_content %}
    -Are you sure you want to delete this stock item? +{% trans "Are you sure you want to delete this stock item?" %}
    -This will remove {{ item.quantity }} units of {{ item.part.full_name }} from stock. +This will remove {% decimal item.quantity %} units of {{ item.part.full_name }} from stock.
    {% endblock %} \ No newline at end of file