From 8232baeed7409a631c1c8a5d4f90cd33627a6df6 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sun, 15 Apr 2018 13:49:47 +1000 Subject: [PATCH] Improved list and detail views for supplier Huzzah for bootstrap --- InvenTree/InvenTree/models.py | 4 +- InvenTree/InvenTree/urls.py | 11 ++--- .../migrations/0015_auto_20180415_0302.py | 20 ++++++++ .../migrations/0016_auto_20180415_0316.py | 20 ++++++++ InvenTree/part/models.py | 2 +- InvenTree/part/templates/navbar.html | 2 +- .../part/templates/part/category_detail.html | 5 ++ .../part/templates/part/category_parts.html | 15 ++++-- .../part/category_subcategories.html | 5 +- InvenTree/part/templates/part/part_base.html | 2 +- InvenTree/static/css/inventree.css | 27 ----------- .../migrations/0006_auto_20180415_0302.py | 20 ++++++++ .../migrations/0005_auto_20180415_0255.py | 30 ++++++++++++ .../supplier/templates/supplier/detail.html | 47 +++++++++++++++---- .../supplier/templates/supplier/index.html | 25 +++++----- InvenTree/supplier/urls.py | 17 +++++-- InvenTree/supplier/views.py | 33 +++++++------ 17 files changed, 201 insertions(+), 84 deletions(-) create mode 100644 InvenTree/part/migrations/0015_auto_20180415_0302.py create mode 100644 InvenTree/part/migrations/0016_auto_20180415_0316.py create mode 100644 InvenTree/stock/migrations/0006_auto_20180415_0302.py create mode 100644 InvenTree/supplier/migrations/0005_auto_20180415_0255.py diff --git a/InvenTree/InvenTree/models.py b/InvenTree/InvenTree/models.py index 64742c5366..990c25bd67 100644 --- a/InvenTree/InvenTree/models.py +++ b/InvenTree/InvenTree/models.py @@ -15,7 +15,7 @@ class Company(models.Model): abstract = True name = models.CharField(max_length=100, unique=True) - description = models.CharField(max_length=500, blank=True) + description = models.CharField(max_length=500) website = models.URLField(blank=True) address = models.CharField(max_length=200, blank=True) @@ -43,7 +43,7 @@ class InvenTreeTree(models.Model): name = models.CharField(max_length=100, unique=True) - description = models.CharField(max_length=250, blank=True) + description = models.CharField(max_length=250) # When a category is deleted, graft the children onto its parent parent = models.ForeignKey('self', diff --git a/InvenTree/InvenTree/urls.py b/InvenTree/InvenTree/urls.py index 47d4caf7c5..312ee2f00f 100644 --- a/InvenTree/InvenTree/urls.py +++ b/InvenTree/InvenTree/urls.py @@ -11,7 +11,7 @@ from part.urls import part_urls from stock.urls import stock_api_urls, stock_api_loc_urls from stock.urls import stock_urls -from supplier.urls import supplier_api_urls, supplier_api_part_urls +#from supplier.urls import supplier_api_urls, supplier_api_part_urls from supplier.urls import supplier_urls from django.conf import settings @@ -46,8 +46,8 @@ apipatterns = [ url(r'^bom/', include(bom_api_urls)), # Supplier URLs - url(r'^supplier/', include(supplier_api_urls)), - url(r'^supplier-part/', include(supplier_api_part_urls)), + #url(r'^supplier/', include(supplier_api_urls)), + #url(r'^supplier-part/', include(supplier_api_part_urls)), #url(r'^price-break/', include(price_break_urls)), #url(r'^manufacturer/', include(manu_urls)), #url(r'^customer/', include(cust_urls)), @@ -69,15 +69,14 @@ apipatterns = [ urlpatterns = [ # API URL - url(r'^api/', include(apipatterns)), + #url(r'^api/', include(apipatterns)), + #url(r'^api-doc/', include_docs_urls(title='InvenTree API')), url(r'^part/', include(part_urls)), url(r'^stock/', include(stock_urls)), url(r'^supplier/', include(supplier_urls)), url(r'^track/', include(tracking_urls)), - url(r'^api-doc/', include_docs_urls(title='InvenTree API')), - url(r'^admin/', admin.site.urls), url(r'^auth/', include('rest_framework.urls', namespace='rest_framework')), ] diff --git a/InvenTree/part/migrations/0015_auto_20180415_0302.py b/InvenTree/part/migrations/0015_auto_20180415_0302.py new file mode 100644 index 0000000000..50365550a7 --- /dev/null +++ b/InvenTree/part/migrations/0015_auto_20180415_0302.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11 on 2018-04-15 03:02 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('part', '0014_auto_20180415_0107'), + ] + + operations = [ + migrations.AlterField( + model_name='partcategory', + name='description', + field=models.CharField(max_length=250), + ), + ] diff --git a/InvenTree/part/migrations/0016_auto_20180415_0316.py b/InvenTree/part/migrations/0016_auto_20180415_0316.py new file mode 100644 index 0000000000..c0a22fff24 --- /dev/null +++ b/InvenTree/part/migrations/0016_auto_20180415_0316.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11 on 2018-04-15 03:16 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('part', '0015_auto_20180415_0302'), + ] + + operations = [ + migrations.AlterField( + model_name='part', + name='description', + field=models.CharField(max_length=250), + ), + ] diff --git a/InvenTree/part/models.py b/InvenTree/part/models.py index a8256f0fb8..9064cd4b40 100644 --- a/InvenTree/part/models.py +++ b/InvenTree/part/models.py @@ -88,7 +88,7 @@ class Part(models.Model): name = models.CharField(max_length=100, unique=True) # Longer description of the part (optional) - description = models.CharField(max_length=250, blank=True) + description = models.CharField(max_length=250) # Internal Part Number (optional) # Potentially multiple parts map to the same internal IPN (variants?) diff --git a/InvenTree/part/templates/navbar.html b/InvenTree/part/templates/navbar.html index 5fce78ebeb..b71ddf4ffc 100644 --- a/InvenTree/part/templates/navbar.html +++ b/InvenTree/part/templates/navbar.html @@ -6,7 +6,7 @@