mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge pull request #1923 from SchrodingersGat/secondary-modals
Secondary modals
This commit is contained in:
commit
681f285aa3
@ -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}`);
|
||||
|
||||
|
@ -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: {},
|
||||
|
@ -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',
|
||||
|
@ -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
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user