mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Added part API
- Build allocation table now makes use of this API - Further steps towards allocation table
This commit is contained in:
parent
1b9c98ae3e
commit
ceea053368
@ -14,6 +14,12 @@
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block js_load %}
|
||||
{{ block.super }}
|
||||
<script src="{% static 'script/inventree/api.js' %}"></script>
|
||||
<script src="{% static 'script/inventree/part.js' %}"></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block js_ready %}
|
||||
{{ block.super }}
|
||||
|
||||
@ -21,15 +27,21 @@
|
||||
sortable: true,
|
||||
columns: [
|
||||
{
|
||||
field: 'sub_part.name',
|
||||
title: 'Part',
|
||||
},
|
||||
{
|
||||
title: 'Source',
|
||||
},
|
||||
{
|
||||
field: 'quantity',
|
||||
title: 'Quantity',
|
||||
}
|
||||
]
|
||||
],
|
||||
});
|
||||
|
||||
getBomList({part: {{ build.part.id }}}).then(function(response) {
|
||||
$("#build-table").bootstrapTable('load', response);
|
||||
});
|
||||
|
||||
{% endblock %}
|
19
InvenTree/static/script/inventree/part.js
Normal file
19
InvenTree/static/script/inventree/part.js
Normal file
@ -0,0 +1,19 @@
|
||||
/* Part API functions
|
||||
* Requires api.js to be loaded first
|
||||
*/
|
||||
|
||||
function getPartCategoryList(filters={}, options={}) {
|
||||
return inventreeGet('/api/part/category/', filters, options);
|
||||
}
|
||||
|
||||
function getSupplierPartList(filters={}, options={}) {
|
||||
return inventreeGet('/api/part/supplier/', filters, options);
|
||||
}
|
||||
|
||||
function getPartList(filters={}, options={}) {
|
||||
return inventreeGet('/api/part/', filters, options);
|
||||
}
|
||||
|
||||
function getBomList(filters={}, options={}) {
|
||||
return inventreeGet('/api/part/bom/', filters, options);
|
||||
}
|
Loading…
Reference in New Issue
Block a user