2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-31 00:51:33 +00:00

Merge pull request from SchrodingersGat/order-parts

Order parts
This commit is contained in:
Oliver
2020-11-27 12:28:04 +11:00
committed by GitHub
5 changed files with 72 additions and 11 deletions
InvenTree
company
order
templates
order
order_wizard
templates

@@ -243,6 +243,22 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) {
});
});
// Callback for 'buy' button
$(table).find('.button-buy').click(function() {
var pk = $(this).attr('pk');
var idx = $(this).closest('tr').attr('data-index');
var row = $(table).bootstrapTable('getData')[idx];
launchModalForm('{% url "order-parts" %}', {
data: {
parts: [
pk,
]
}
});
});
// Callback for 'build' button
$(table).find('.button-build').click(function() {
var pk = $(this).attr('pk');
@@ -563,7 +579,7 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) {
}
if (row.sub_part_detail.purchaseable) {
html += makeIconButton('fa-shopping-cart icon-blue', 'button-buy', row.sub_part, '{% trans "Order stock" %}', {disabled: true});
html += makeIconButton('fa-shopping-cart icon-blue', 'button-buy', row.sub_part, '{% trans "Order stock" %}');
}
html += makeIconButton('fa-sign-in-alt icon-green', 'button-add', row.sub_part, '{% trans "Allocate stock" %}');

@@ -21,9 +21,16 @@ function newSupplierPartFromOrderWizard(e) {
e = e || window.event;
var src = e.target || e.srcElement;
var src = e.srcElement || e.target;
var part = $(src).attr('part-id');
var part = $(src).attr('part');
console.log('part: ' + part);
if (!part) {
part = $(src).closest('button').attr('part');
console.log('parent: ' + part);
}
launchModalForm("/supplier-part/new/", {
modal: '#modal-form-secondary',
@@ -125,7 +132,7 @@ function loadPurchaseOrderTable(table, options) {
name: 'purchaseorder',
groupBy: false,
original: options.params,
formatNoMatches: function() { return "{% trans "No purchase orders found" %}"; },
formatNoMatches: function() { return '{% trans "No purchase orders found" %}'; },
columns: [
{
field: 'pk',
@@ -208,7 +215,7 @@ function loadSalesOrderTable(table, options) {
name: 'salesorder',
groupBy: false,
original: options.params,
formatNoMatches: function() { return "{% trans "No sales orders found" %}"; },
formatNoMatches: function() { return '{% trans "No sales orders found" %}'; },
columns: [
{
field: 'pk',
@@ -265,7 +272,7 @@ function loadSalesOrderTable(table, options) {
{
sortable: true,
field: 'shipment_date',
title: "{% trans "Shipment Date" %}",
title: '{% trans "Shipment Date" %}',
},
{
sortable: true,