Merge remote-tracking branch 'inventree/master'

This commit is contained in:
Oliver Walters 2020-06-06 08:59:28 +10:00
commit a6a58b299b
8 changed files with 17 additions and 23 deletions

View File

@ -107,8 +107,6 @@ $.fn.inventreeTable = function(options) {
function customGroupSorter(sortName, sortOrder, sortData) {
console.log('got here');
var order = sortOrder === 'desc' ? -1 : 1;
sortData.sort(function(a, b) {

View File

@ -111,10 +111,6 @@ src="{% static 'img/blank_image.png' %}"
</table>
{% endblock %}
{% block js_load %}
<script type='text/javascript' src="{% static 'script/inventree/stock.js' %}"></script>
{% endblock %}
{% block js_ready %}
$("#build-edit").click(function () {

View File

@ -14,11 +14,6 @@
{% endblock %}
{% block js_load %}
{{ block.super }}
<script type='text/javascript' src="{% static 'script/inventree/stock.js' %}"></script>
{% endblock %}
{% block js_ready %}
{{ block.super }}

View File

@ -103,6 +103,9 @@ class PartBriefSerializer(InvenTreeModelSerializer):
model = Part
fields = [
'pk',
'IPN',
'name',
'revision',
'full_name',
'description',
'thumbnail',

View File

@ -26,12 +26,6 @@ InvenTree | {% trans "Part List" %}
{% endblock %}
{% block js_load %}
{{ block.super }}
<script type='text/javascript' src="{% static 'script/inventree/part.js' %}"></script>
<script type='text/javascript' src="{% static 'script/inventree/stock.js' %}"></script>
{% endblock %}
{% block js_ready %}
{{ block.super }}

View File

@ -22,11 +22,6 @@ InvenTree | Stock
{% endif %}
{% endblock %}
{% block js_load %}
{{ block.super }}
<script type='text/javascript' src="{% static 'script/inventree/stock.js' %}"></script>
{% endblock %}
{% block js_ready %}
{{ block.super }}
loadTree("{% url 'api-stock-tree' %}",

View File

@ -262,6 +262,7 @@ function loadStockTable(table, options) {
customSort: customGroupSorter,
groupBy: true,
original: original,
showColumns: true,
groupByField: options.groupByField || 'part',
groupByFormatter: function(field, id, data) {
@ -273,6 +274,9 @@ function loadStockTable(table, options) {
return imageHoverIcon(row.part_detail.thumbnail) + name + ' <i>(' + data.length + ' items)</i>';
}
else if (field == 'IPN') {
return row.part_detail.IPN;
}
else if (field == 'part_description') {
return row.part_detail.description;
}
@ -403,6 +407,15 @@ function loadStockTable(table, options) {
field: 'pk',
title: 'ID',
visible: false,
switchable: false,
},
{
field: 'IPN',
title: 'IPN',
sortable: true,
formatter: function(value, row, index, field) {
return row.part_detail.IPN;
},
},
{
field: 'part_name',

View File

@ -1,5 +1,5 @@
wheel>=0.34.2 # Wheel
Django==3.0.5 # Django package
Django==3.0.7 # Django package
pillow==6.2.2 # Image manipulation
djangorestframework==3.10.3 # DRF framework
django-dbbackup==3.3.0 # Database backup / restore functionality