mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add buttons to create new builds or orders for sales order parts
- Need to pre-fill the forms a bit better
This commit is contained in:
parent
6112be2df0
commit
a803f21e0c
@ -45,6 +45,7 @@ $("#so-lines-table").inventreeTable({
|
|||||||
allocations: true,
|
allocations: true,
|
||||||
},
|
},
|
||||||
url: "{% url 'api-so-line-list' %}",
|
url: "{% url 'api-so-line-list' %}",
|
||||||
|
detailViewByClick: true,
|
||||||
detailView: true,
|
detailView: true,
|
||||||
detailFilter: function(index, row) {
|
detailFilter: function(index, row) {
|
||||||
return row.allocated > 0;
|
return row.allocated > 0;
|
||||||
@ -174,11 +175,11 @@ $("#so-lines-table").inventreeTable({
|
|||||||
var part = row.part_detail;
|
var part = row.part_detail;
|
||||||
|
|
||||||
if (part.purchaseable) {
|
if (part.purchaseable) {
|
||||||
html += makeIconButton('fa-shopping-cart', 'button-buy', pk, '{% trans "Buy parts" %}');
|
html += makeIconButton('fa-shopping-cart', 'button-buy', row.part, '{% trans "Buy parts" %}');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (part.assembly) {
|
if (part.assembly) {
|
||||||
html += makeIconButton('fa-tools', 'button-build', pk, '{% trans "Build parts" %}');
|
html += makeIconButton('fa-tools', 'button-build', row.part, '{% trans "Build parts" %}');
|
||||||
}
|
}
|
||||||
|
|
||||||
html += makeIconButton('fa-plus', 'button-add', pk, '{% trans "Allocate parts" %}');
|
html += makeIconButton('fa-plus', 'button-add', pk, '{% trans "Allocate parts" %}');
|
||||||
@ -235,9 +236,24 @@ $("#so-lines-table").on('load-success.bs.table', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
table.find(".button-build").click(function() {
|
table.find(".button-build").click(function() {
|
||||||
|
var pk = $(this).attr('pk');
|
||||||
|
|
||||||
|
launchModalForm(`/build/new/`, {
|
||||||
|
follow: true,
|
||||||
|
data: {
|
||||||
|
part: pk,
|
||||||
|
},
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
table.find(".button-buy").click(function() {
|
table.find(".button-buy").click(function() {
|
||||||
|
var pk = $(this).attr('pk');
|
||||||
|
|
||||||
|
launchModalForm("{% url 'order-parts' %}", {
|
||||||
|
data: {
|
||||||
|
parts: [pk],
|
||||||
|
},
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user