From 41a40334274d070cd3f07e55f4def1600dec445c Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Fri, 24 Apr 2020 17:18:18 +1000 Subject: [PATCH] Selective display of sales order ilne buttons --- .../order/templates/order/sales_order_detail.html | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/InvenTree/order/templates/order/sales_order_detail.html b/InvenTree/order/templates/order/sales_order_detail.html index 9d6aad6543..ab72fe5bfb 100644 --- a/InvenTree/order/templates/order/sales_order_detail.html +++ b/InvenTree/order/templates/order/sales_order_detail.html @@ -85,12 +85,14 @@ $("#so-lines-table").inventreeTable({ field: 'buttons', title: 'Actions', formatter: function(value, row, index, field) { - + var html = "
"; var pk = row.pk; - + + {% if order.status == SalesOrderStatus.PENDING %} html += makeIconButton('fa-edit', 'button-allocation-edit', pk, '{% trans "Edit stock allocation" %}'); html += makeIconButton('fa-trash-alt', 'button-allocation-delete', pk, '{% trans "Delete stock allocation" %}'); + {% endif %} html += "
"; @@ -177,7 +179,8 @@ $("#so-lines-table").inventreeTable({ var html = `
`; var pk = row.pk; - + + {% if order.status == SalesOrderStatus.PENDING %} if (row.part) { var part = row.part_detail; @@ -189,13 +192,14 @@ $("#so-lines-table").inventreeTable({ html += makeIconButton('fa-tools', 'button-build', row.part, '{% trans "Build parts" %}'); } - html += makeIconButton('fa-plus', 'button-add', pk, '{% trans "Allocate parts" %}'); - + html += makeIconButton('fa-plus', 'button-add', pk, '{% trans "Allocate parts" %}'); } html += makeIconButton('fa-edit', 'button-edit', pk, '{% trans "Edit line item" %}'); html += makeIconButton('fa-trash-alt', 'button-delete', pk, '{% trans "Delete line item " %}'); + {% endif %} + html += `
`; return html;