diff --git a/InvenTree/templates/js/translated/forms.js b/InvenTree/templates/js/translated/forms.js index 8f8ea71d54..4b41623fbf 100644 --- a/InvenTree/templates/js/translated/forms.js +++ b/InvenTree/templates/js/translated/forms.js @@ -1240,7 +1240,9 @@ function setRelatedFieldData(name, data, options) { } -function initializeChoiceField(name, field, options) { +function initializeChoiceField(field, fields, options) { + + var name = field.name; var select = $(options.modal).find(`#id_${name}`); diff --git a/InvenTree/templates/js/translated/order.js b/InvenTree/templates/js/translated/order.js index 86035c5c47..8a8f45103c 100644 --- a/InvenTree/templates/js/translated/order.js +++ b/InvenTree/templates/js/translated/order.js @@ -13,6 +13,16 @@ function createSalesOrder(options={}) { }, customer: { value: options.customer, + secondary: { + title: '{% trans "Add Customer" %}', + fields: function(data) { + var fields = companyFormFields(); + + fields.is_customer.value = true; + + return fields; + } + } }, customer_reference: {}, description: {}, @@ -44,6 +54,16 @@ function createPurchaseOrder(options={}) { }, supplier: { value: options.supplier, + secondary: { + title: '{% trans "Add Supplier" %}', + fields: function(data) { + var fields = companyFormFields(); + + fields.is_supplier.value = true; + + return fields; + } + } }, supplier_reference: {}, description: {}, diff --git a/InvenTree/templates/js/translated/part.js b/InvenTree/templates/js/translated/part.js index 3def7abdad..6f51f492c4 100644 --- a/InvenTree/templates/js/translated/part.js +++ b/InvenTree/templates/js/translated/part.js @@ -17,7 +17,16 @@ function yesNoLabel(value) { function partFields(options={}) { var fields = { - category: {}, + category: { + secondary: { + title: '{% trans "Add Part Category" %}', + fields: function(data) { + var fields = categoryFields(); + + return fields; + } + } + }, name: {}, IPN: {}, revision: {}, @@ -30,7 +39,8 @@ function partFields(options={}) { link: { icon: 'fa-link', }, - default_location: {}, + default_location: { + }, default_supplier: {}, default_expiry: { icon: 'fa-calendar-alt', diff --git a/InvenTree/templates/js/translated/stock.js b/InvenTree/templates/js/translated/stock.js index 826048471d..36b3bea03a 100644 --- a/InvenTree/templates/js/translated/stock.js +++ b/InvenTree/templates/js/translated/stock.js @@ -2,6 +2,18 @@ {% load inventree_extras %} {% load status_codes %} + +function locationFields() { + return { + parent: { + help_text: '{% trans "Parent stock location" %}', + }, + name: {}, + description: {}, + }; +} + + /* Stock API functions * Requires api.js to be loaded first */