mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-01 19:20:55 +00:00
Create new stock location via API forms
This commit is contained in:
@ -59,13 +59,19 @@
|
||||
|
||||
|
||||
function stockLocationFields(options={}) {
|
||||
return {
|
||||
var fields = {
|
||||
parent: {
|
||||
help_text: '{% trans "Parent stock location" %}',
|
||||
},
|
||||
name: {},
|
||||
description: {},
|
||||
};
|
||||
|
||||
if (options.parent) {
|
||||
fields.parent.value = options.parent;
|
||||
}
|
||||
|
||||
return fields;
|
||||
}
|
||||
|
||||
|
||||
@ -82,6 +88,20 @@ function editStockLocation(pk, options={}) {
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Launch an API form to create a new stock location
|
||||
*/
|
||||
function createStockLocation(options={}) {
|
||||
|
||||
var url = '{% url "api-location-list" %}';
|
||||
|
||||
options.method = 'POST';
|
||||
options.fields = stockLocationFields(options);
|
||||
|
||||
constructForm(url, options);
|
||||
}
|
||||
|
||||
|
||||
function stockItemFields(options={}) {
|
||||
var fields = {
|
||||
part: {},
|
||||
|
Reference in New Issue
Block a user