mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add option to disable stock item grouping
This commit is contained in:
parent
e8bacbe45f
commit
098b494047
@ -242,6 +242,13 @@ class InvenTreeSetting(models.Model):
|
||||
'validator': bool,
|
||||
},
|
||||
|
||||
'STOCK_GROUP_BY_PART': {
|
||||
'name': _('Group by Part'),
|
||||
'description': _('Group stock items by part reference in table views'),
|
||||
'default': True,
|
||||
'validator': bool,
|
||||
},
|
||||
|
||||
'BUILDORDER_REFERENCE_PREFIX': {
|
||||
'name': _('Build Order Reference Prefix'),
|
||||
'description': _('Prefix value for build order reference'),
|
||||
|
@ -15,11 +15,12 @@
|
||||
<table class='table table-striped table-condensed'>
|
||||
{% include "InvenTree/settings/header.html" %}
|
||||
<tbody>
|
||||
{% include "InvenTree/settings/setting.html" with key="STOCK_ENABLE_EXPIRY" %}
|
||||
{% include "InvenTree/settings/setting.html" with key="STOCK_STALE_DAYS" %}
|
||||
{% include "InvenTree/settings/setting.html" with key="STOCK_ALLOW_EXPIRED_SALE" %}
|
||||
{% include "InvenTree/settings/setting.html" with key="STOCK_ALLOW_EXPIRED_BUILD" %}
|
||||
{% include "InvenTree/settings/setting.html" with key="STOCK_OWNERSHIP_CONTROL" %}
|
||||
{% include "InvenTree/settings/setting.html" with key="STOCK_GROUP_BY_PART" icon="fa-layer-group" %}
|
||||
{% include "InvenTree/settings/setting.html" with key="STOCK_ENABLE_EXPIRY" icon="fa-stopwatch" %}
|
||||
{% include "InvenTree/settings/setting.html" with key="STOCK_STALE_DAYS" icon="fa-calendar" %}
|
||||
{% include "InvenTree/settings/setting.html" with key="STOCK_ALLOW_EXPIRED_SALE" icon="fa-truck" %}
|
||||
{% include "InvenTree/settings/setting.html" with key="STOCK_ALLOW_EXPIRED_BUILD" icon="fa-tools" %}
|
||||
{% include "InvenTree/settings/setting.html" with key="STOCK_OWNERSHIP_CONTROL" icon="fa-users" %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock %}
|
||||
|
@ -327,11 +327,13 @@ function loadStockTable(table, options) {
|
||||
url: options.url || "{% url 'api-stock-list' %}",
|
||||
queryParams: filters,
|
||||
customSort: customGroupSorter,
|
||||
groupBy: true,
|
||||
name: 'stock',
|
||||
original: original,
|
||||
showColumns: true,
|
||||
{% settings_value 'STOCK_GROUP_BY_PART' as group_by_part %}
|
||||
{% if group_by_part %}
|
||||
groupByField: options.groupByField || 'part',
|
||||
groupBy: true,
|
||||
groupByFormatter: function(field, id, data) {
|
||||
|
||||
var row = data[0];
|
||||
@ -363,9 +365,9 @@ function loadStockTable(table, options) {
|
||||
var packaging = [];
|
||||
|
||||
data.forEach(function(item) {
|
||||
var pkg = String(item.packaging);
|
||||
var pkg = item.packaging;
|
||||
|
||||
if (!pkg || pkg == '') {
|
||||
if (!pkg) {
|
||||
pkg = '-';
|
||||
}
|
||||
|
||||
@ -491,6 +493,7 @@ function loadStockTable(table, options) {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
{% endif %}
|
||||
columns: [
|
||||
{
|
||||
checkbox: true,
|
||||
|
Loading…
Reference in New Issue
Block a user