mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add action buttons to the sales order page
This commit is contained in:
parent
15166c7797
commit
b75c343236
@ -78,6 +78,22 @@ function getImageUrlFromTransfer(transfer) {
|
|||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function makeIconButton(icon, id, opts) {
|
||||||
|
// Construct an 'icon button' using the fontawesome set
|
||||||
|
|
||||||
|
var options = opts || {};
|
||||||
|
|
||||||
|
var title = options.title || '';
|
||||||
|
|
||||||
|
var html = '';
|
||||||
|
|
||||||
|
html += `<button id='${id}' class='btn btn-default btn-glyph' title='${title}'>`;
|
||||||
|
html += `<span class='fas ${icon}'></span>`;
|
||||||
|
html += `</button>`;
|
||||||
|
|
||||||
|
return html;
|
||||||
|
}
|
||||||
|
|
||||||
function makeProgressBar(value, maximum, opts) {
|
function makeProgressBar(value, maximum, opts) {
|
||||||
/*
|
/*
|
||||||
* Render a progessbar!
|
* Render a progessbar!
|
||||||
|
@ -156,7 +156,30 @@ $("#so-lines-table").inventreeTable({
|
|||||||
{
|
{
|
||||||
field: 'buttons',
|
field: 'buttons',
|
||||||
formatter: function(value, row, index, field) {
|
formatter: function(value, row, index, field) {
|
||||||
return '-';
|
|
||||||
|
var html = '';
|
||||||
|
|
||||||
|
var pk = row.pk;
|
||||||
|
|
||||||
|
if (row.part) {
|
||||||
|
var part = row.part_detail;
|
||||||
|
|
||||||
|
html = `<div class='btn-group float-right' role='group'>`;
|
||||||
|
|
||||||
|
html += makeIconButton('fa-plus', `button-add-${pk}`);
|
||||||
|
|
||||||
|
if (part.purchaseable) {
|
||||||
|
html += makeIconButton('fa-shopping-cart', `button-buy-${pk}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (part.assembly) {
|
||||||
|
html += makeIconButton('fa-tools', `button-build-${pk}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
html += `</div>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return html;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -65,6 +65,8 @@ class PartBriefSerializer(InvenTreeModelSerializer):
|
|||||||
'thumbnail',
|
'thumbnail',
|
||||||
'active',
|
'active',
|
||||||
'assembly',
|
'assembly',
|
||||||
|
'purchaseable',
|
||||||
|
'salable',
|
||||||
'virtual',
|
'virtual',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user