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) { function customGroupSorter(sortName, sortOrder, sortData) {
console.log('got here');
var order = sortOrder === 'desc' ? -1 : 1; var order = sortOrder === 'desc' ? -1 : 1;
sortData.sort(function(a, b) { sortData.sort(function(a, b) {

View File

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

View File

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

View File

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

View File

@ -26,12 +26,6 @@ InvenTree | {% trans "Part List" %}
{% endblock %} {% 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 js_ready %}
{{ block.super }} {{ block.super }}

View File

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

View File

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

View File

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