From beaa93f9b577515b8fd876d8e8e7d72a0d12eb1a Mon Sep 17 00:00:00 2001 From: Oliver Date: Mon, 27 Sep 2021 11:41:24 +1000 Subject: [PATCH 1/3] Fix ?display= URLs for part stock view --- InvenTree/templates/js/translated/bom.js | 2 +- InvenTree/templates/js/translated/part.js | 2 +- InvenTree/templates/js/translated/stock.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/InvenTree/templates/js/translated/bom.js b/InvenTree/templates/js/translated/bom.js index bcfa7ef5ff..8f571df02e 100644 --- a/InvenTree/templates/js/translated/bom.js +++ b/InvenTree/templates/js/translated/bom.js @@ -271,7 +271,7 @@ function loadBomTable(table, options) { sortable: true, formatter: function(value, row) { - var url = `/part/${row.sub_part_detail.pk}/?display=stock`; + var url = `/part/${row.sub_part_detail.pk}/?display=part-stock`; var text = value; if (value == null || value <= 0) { diff --git a/InvenTree/templates/js/translated/part.js b/InvenTree/templates/js/translated/part.js index 6e8c02c0b1..afd1b4def8 100644 --- a/InvenTree/templates/js/translated/part.js +++ b/InvenTree/templates/js/translated/part.js @@ -539,7 +539,7 @@ function loadPartVariantTable(table, partId, options={}) { field: 'in_stock', title: '{% trans "Stock" %}', formatter: function(value, row) { - return renderLink(value, `/part/${row.pk}/?display=stock`); + return renderLink(value, `/part/${row.pk}/?display=part-stock`); } } ]; diff --git a/InvenTree/templates/js/translated/stock.js b/InvenTree/templates/js/translated/stock.js index e35831624e..17c2598d1b 100644 --- a/InvenTree/templates/js/translated/stock.js +++ b/InvenTree/templates/js/translated/stock.js @@ -1019,7 +1019,7 @@ function loadStockTable(table, options) { return '-'; } - var link = `/supplier-part/${row.supplier_part}/?display=stock`; + var link = `/supplier-part/${row.supplier_part}/?display=part-stock`; var text = ''; From ef01bdff07e818fca2d386b790461d78cad82ce6 Mon Sep 17 00:00:00 2001 From: Oliver Date: Mon, 27 Sep 2021 11:42:47 +1000 Subject: [PATCH 2/3] Fix links in part table --- InvenTree/templates/js/translated/part.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/InvenTree/templates/js/translated/part.js b/InvenTree/templates/js/translated/part.js index afd1b4def8..aba3c46330 100644 --- a/InvenTree/templates/js/translated/part.js +++ b/InvenTree/templates/js/translated/part.js @@ -945,7 +945,7 @@ function loadPartTable(table, url, options={}) { title: '{% trans "Stock" %}', searchable: false, formatter: function(value, row) { - var link = 'stock'; + var link = '?display=part-stock'; if (value) { // There IS stock available for this part @@ -958,17 +958,17 @@ function loadPartTable(table, url, options={}) { } else if (row.on_order) { // There is no stock available, but stock is on order value = `0{% trans "On Order" %}: ${row.on_order}`; - link = 'orders'; + link = '?display=purchase-orders'; } else if (row.building) { // There is no stock available, but stock is being built value = `0{% trans "Building" %}: ${row.building}`; - link = 'builds'; + link = '?display=build-orders'; } else { // There is no stock available value = `0{% trans "No Stock" %}`; } - return renderLink(value, `/part/${row.pk}/${link}/`); + return renderLink(value, `/part/${row.pk}/${link}`); } }; From 26e3dbd9d0ce56ff32a520b40fe93eaa083de394 Mon Sep 17 00:00:00 2001 From: Oliver Date: Mon, 27 Sep 2021 11:46:14 +1000 Subject: [PATCH 3/3] Remove debug message --- InvenTree/InvenTree/version.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/InvenTree/InvenTree/version.py b/InvenTree/InvenTree/version.py index 33a4aa3c0e..f302c84d6f 100644 --- a/InvenTree/InvenTree/version.py +++ b/InvenTree/InvenTree/version.py @@ -88,9 +88,6 @@ def isInvenTreeDevelopmentVersion(): """ Return True if current InvenTree version is a "development" version """ - - print("is dev?", inventreeVersion()) - return inventreeVersion().endswith('dev')