From 9eb1367d8047a9163f9f722d6c462976eecdbf5a Mon Sep 17 00:00:00 2001 From: Oliver Date: Sun, 11 Jul 2021 21:07:56 +1000 Subject: [PATCH] Add "location" field --- InvenTree/templates/js/forms.js | 1 - InvenTree/templates/js/stock.js | 10 +++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/InvenTree/templates/js/forms.js b/InvenTree/templates/js/forms.js index d68ce64c45..490b67944f 100644 --- a/InvenTree/templates/js/forms.js +++ b/InvenTree/templates/js/forms.js @@ -400,7 +400,6 @@ function constructFormBody(fields, options) { // Field not specified in the API, but the client wishes to add it! if (!(name in fields)) { fields[name] = displayed_fields[name]; - console.log(`WARNING: '${name}' does not match a valid field name.`); } } diff --git a/InvenTree/templates/js/stock.js b/InvenTree/templates/js/stock.js index e78e06c0ff..80249b2870 100644 --- a/InvenTree/templates/js/stock.js +++ b/InvenTree/templates/js/stock.js @@ -132,7 +132,7 @@ function adjustStock(items, options={}) { var buttons = `
`; buttons += makeIconButton( - 'fa-trash-alt icon-red', + 'fa-times icon-red', 'button-stock-item-remove', pk, '{% trans "Remove stock item" %}', @@ -163,6 +163,14 @@ function adjustStock(items, options={}) { constructFormBody({}, { fields: { + location: { + label: '{% trans "Location" %}', + help_text: '{% trans "Select stock location" %}', + type: 'related field', + required: true, + api_url: `/api/stock/location/`, + model: 'stocklocation', + }, note: { label: '{% trans "Notes" %}', help_text: '{% trans "Stock transaction notes" %}',