diff --git a/InvenTree/templates/js/dynamic/inventree.js b/InvenTree/InvenTree/static/script/inventree/inventree.js
similarity index 74%
rename from InvenTree/templates/js/dynamic/inventree.js
rename to InvenTree/InvenTree/static/script/inventree/inventree.js
index 1774ba6f3d..b4f7114448 100644
--- a/InvenTree/templates/js/dynamic/inventree.js
+++ b/InvenTree/InvenTree/static/script/inventree/inventree.js
@@ -1,5 +1,3 @@
-{% load inventree_extras %}
-
/* globals
ClipboardJS,
inventreeFormDataUpload,
@@ -130,66 +128,68 @@ function inventreeDocReady() {
attachClipboard('.clip-btn-version', 'modal-about', 'about-copy-text');
// Add autocomplete to the search-bar
- $('#search-bar').autocomplete({
- source: function(request, response) {
- $.ajax({
- url: '/api/part/',
- data: {
- search: request.term,
- limit: user_settings.SEARCH_PREVIEW_RESULTS,
- offset: 0
- },
- success: function(data) {
+ if ($('#search-bar').exists()) {
+ $('#search-bar').autocomplete({
+ source: function(request, response) {
+ $.ajax({
+ url: '/api/part/',
+ data: {
+ search: request.term,
+ limit: user_settings.SEARCH_PREVIEW_RESULTS,
+ offset: 0
+ },
+ success: function(data) {
- var transformed = $.map(data.results, function(el) {
- return {
- label: el.full_name,
- id: el.pk,
- thumbnail: el.thumbnail,
- data: el,
- };
- });
- response(transformed);
- },
- error: function() {
- response([]);
- }
- });
- },
- create: function() {
- $(this).data('ui-autocomplete')._renderItem = function(ul, item) {
+ var transformed = $.map(data.results, function(el) {
+ return {
+ label: el.full_name,
+ id: el.pk,
+ thumbnail: el.thumbnail,
+ data: el,
+ };
+ });
+ response(transformed);
+ },
+ error: function() {
+ response([]);
+ }
+ });
+ },
+ create: function() {
+ $(this).data('ui-autocomplete')._renderItem = function(ul, item) {
- var html = ``;
+ var html = ``;
- html += ` `;
- html += item.label;
+ html += `
`;
+ html += item.label;
- html += '';
-
- if (user_settings.SEARCH_SHOW_STOCK_LEVELS) {
- html += partStockLabel(
- item.data,
- {
- classes: 'badge-right',
- }
- );
- }
+ html += '';
+
+ if (user_settings.SEARCH_SHOW_STOCK_LEVELS) {
+ html += partStockLabel(
+ item.data,
+ {
+ classes: 'badge-right',
+ }
+ );
+ }
- html += '';
+ html += '';
- return $('