diff --git a/InvenTree/company/migrations/0033_auto_20210410_1528.py b/InvenTree/company/migrations/0033_auto_20210410_1528.py new file mode 100644 index 0000000000..12153a9ef6 --- /dev/null +++ b/InvenTree/company/migrations/0033_auto_20210410_1528.py @@ -0,0 +1,18 @@ +# Generated by Django 3.0.7 on 2021-04-10 05:28 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('company', '0032_auto_20210403_1837'), + ] + + operations = [ + migrations.AlterField( + model_name='company', + name='description', + field=models.CharField(blank=True, help_text='Description of the company', max_length=500, verbose_name='Company description'), + ), + ] diff --git a/InvenTree/company/models.py b/InvenTree/company/models.py index 17091dcbc3..d83748c930 100644 --- a/InvenTree/company/models.py +++ b/InvenTree/company/models.py @@ -95,7 +95,12 @@ class Company(models.Model): help_text=_('Company name'), verbose_name=_('Company name')) - description = models.CharField(max_length=500, verbose_name=_('Company description'), help_text=_('Description of the company')) + description = models.CharField( + max_length=500, + verbose_name=_('Company description'), + help_text=_('Description of the company'), + blank=True, + ) website = models.URLField(blank=True, verbose_name=_('Website'), help_text=_('Company website URL')) diff --git a/InvenTree/company/templates/company/supplier_part_stock.html b/InvenTree/company/templates/company/supplier_part_stock.html index 49a5a809c2..524c508957 100644 --- a/InvenTree/company/templates/company/supplier_part_stock.html +++ b/InvenTree/company/templates/company/supplier_part_stock.html @@ -22,7 +22,7 @@ params: { supplier_part: {{ part.id }}, location_detail: true, - part_detail: true, + part_detail: false, }, groupByField: 'location', buttons: ['#stock-options'], diff --git a/InvenTree/part/admin.py b/InvenTree/part/admin.py index 4681404ba1..af2f615803 100644 --- a/InvenTree/part/admin.py +++ b/InvenTree/part/admin.py @@ -16,8 +16,6 @@ from .models import PartCategoryParameterTemplate from .models import PartTestTemplate from .models import PartSellPriceBreak -from InvenTree.helpers import normalize - from stock.models import StockLocation from company.models import SupplierPart @@ -180,7 +178,7 @@ class BomItemResource(ModelResource): Ref: https://django-import-export.readthedocs.io/en/latest/getting_started.html#advanced-data-manipulation-on-export """ - return normalize(item.quantity) + return float(item.quantity) def before_export(self, queryset, *args, **kwargs): diff --git a/InvenTree/part/templates/part/stock.html b/InvenTree/part/templates/part/stock.html index cd4f9ab2fa..2d1385f89c 100644 --- a/InvenTree/part/templates/part/stock.html +++ b/InvenTree/part/templates/part/stock.html @@ -40,7 +40,7 @@ params: { part: {{ part.id }}, location_detail: true, - part_detail: true, + part_detail: false, }, groupByField: 'location', buttons: [ diff --git a/InvenTree/stock/templates/stock/item_base.html b/InvenTree/stock/templates/stock/item_base.html index a72b727f69..04518a0c65 100644 --- a/InvenTree/stock/templates/stock/item_base.html +++ b/InvenTree/stock/templates/stock/item_base.html @@ -165,13 +165,13 @@ InvenTree | {% trans "Stock Item" %} - {{ item }} {% if item.in_stock %}
  • {% trans "Remove stock" %}
  • {% endif %} - {% if item.in_stock and item.can_adjust_location %} -
  • {% trans "Transfer stock" %}
  • - {% endif %} {% if item.in_stock and item.part.trackable %}
  • {% trans "Serialize stock" %}
  • {% endif %} {% endif %} + {% if item.in_stock and item.can_adjust_location %} +
  • {% trans "Transfer stock" %}
  • + {% endif %} {% if item.in_stock and item.can_adjust_location and item.part.salable and not item.customer %}
  • {% trans "Assign to customer" %}
  • {% endif %} diff --git a/InvenTree/templates/InvenTree/index.html b/InvenTree/templates/InvenTree/index.html index b7807840c5..f7154e5fbb 100644 --- a/InvenTree/templates/InvenTree/index.html +++ b/InvenTree/templates/InvenTree/index.html @@ -131,6 +131,7 @@ addHeaderAction('stock-to-build', '{% trans "Required for Build Orders" %}', 'fa loadStockTable($('#table-recently-updated-stock'), { params: { + part_detail: true, ordering: "-updated", max_results: {% settings_value "STOCK_RECENT_COUNT" %}, }, diff --git a/InvenTree/templates/js/stock.js b/InvenTree/templates/js/stock.js index 02714810e3..b163bc89f3 100644 --- a/InvenTree/templates/js/stock.js +++ b/InvenTree/templates/js/stock.js @@ -241,7 +241,6 @@ function loadStockTable(table, options) { // List of user-params which override the default filters - options.params['part_detail'] = true; options.params['location_detail'] = true; var params = options.params || {}; @@ -524,7 +523,8 @@ function loadStockTable(table, options) { title: '{% trans "Part" %}', sortName: 'part__name', sortable: true, - switchable: false, + visible: params['part_detail'], + switchable: params['part_detail'], formatter: function(value, row, index, field) { var url = `/stock/item/${row.pk}/`; @@ -543,6 +543,8 @@ function loadStockTable(table, options) { title: 'IPN', sortName: 'part__IPN', sortable: true, + visible: params['part_detail'], + switchable: params['part_detail'], formatter: function(value, row, index, field) { return row.part_detail.IPN; }, @@ -550,6 +552,8 @@ function loadStockTable(table, options) { { field: 'part_detail.description', title: '{% trans "Description" %}', + visible: params['part_detail'], + switchable: params['part_detail'], formatter: function(value, row, index, field) { return row.part_detail.description; }