diff --git a/InvenTree/InvenTree/urls.py b/InvenTree/InvenTree/urls.py index 7ef9e6163c..35d17add38 100644 --- a/InvenTree/InvenTree/urls.py +++ b/InvenTree/InvenTree/urls.py @@ -68,12 +68,16 @@ urlpatterns = [ # url(r'^api-doc/', include_docs_urls(title='InvenTree API')), url(r'^part/', include(part_urls)), - url(r'^stock/', include(stock_urls)), - url(r'^company/', include(company_urls)), url(r'^supplier-part/', include(supplier_part_urls)), + + url(r'^stock/', include(stock_urls)), + + url(r'^company/', include(company_urls)), + url(r'^build/', include(build_urls)), url(r'^admin/', admin.site.urls), + url(r'^auth/', include('rest_framework.urls', namespace='rest_framework')), ] diff --git a/InvenTree/company/forms.py b/InvenTree/company/forms.py index b9766e3f36..c710e88d7c 100644 --- a/InvenTree/company/forms.py +++ b/InvenTree/company/forms.py @@ -51,5 +51,7 @@ class EditCompanyForm(forms.ModelForm): 'email', 'contact', 'image', + 'is_customer', + 'is_supplier', 'notes' ] diff --git a/InvenTree/company/migrations/0002_auto_20180422_1201.py b/InvenTree/company/migrations/0002_auto_20180422_1201.py new file mode 100644 index 0000000000..38578a58fe --- /dev/null +++ b/InvenTree/company/migrations/0002_auto_20180422_1201.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.12 on 2018-04-22 12:01 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('company', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='company', + name='is_customer', + field=models.BooleanField(default=False), + ), + migrations.AddField( + model_name='company', + name='is_supplier', + field=models.BooleanField(default=False), + ), + ] diff --git a/InvenTree/company/models.py b/InvenTree/company/models.py index 38da4cb7f3..b18b539b63 100644 --- a/InvenTree/company/models.py +++ b/InvenTree/company/models.py @@ -49,6 +49,10 @@ class Company(models.Model): notes = models.TextField(blank=True) + is_customer = models.BooleanField(default=False) + + is_supplier = models.BooleanField(default=False) + def __str__(self): return self.name diff --git a/InvenTree/company/templates/company/company_base.html b/InvenTree/company/templates/company/company_base.html new file mode 100644 index 0000000000..2fd12d5348 --- /dev/null +++ b/InvenTree/company/templates/company/company_base.html @@ -0,0 +1,62 @@ +{% extends "base.html" %} + +{% load static %} + +{% block content %} + +
+
+
+
+ +
+
+

{{ company.name }}

+

{{ company.description }}

+
+ +
+
+
+ + {% if company.website %} + + + + {% endif %} + {% if company.address %} + + + + {% endif %} + {% if company.phone %} + + + + {% endif %} + {% if company.email %} + + + + {% endif %} + {% if company.contact %} + + + + {% endif %} +
Website{{ company.website }}
Address{{ company.address }}
Phone{{ company.phone }}
Email{{ company.email }}
Contact{{ company.contact }}
+
+
+ +{% block details %} + +{% endblock %} + +{% endblock %} \ No newline at end of file diff --git a/InvenTree/company/templates/company/detail.html b/InvenTree/company/templates/company/detail.html index 6f43d575e6..8c60890ee1 100644 --- a/InvenTree/company/templates/company/detail.html +++ b/InvenTree/company/templates/company/detail.html @@ -1,46 +1,5 @@ -{% extends "supplier/supplier_base.html" %} +{% extends "company/company_base.html" %} {% block details %} -{% include "supplier/tabs.html" with tab='parts' %} - -

Supplier Parts

- - - - - - - - -{% for part in supplier.parts.all %} - - - - - - -{% endfor %} -
SKUDescriptionParent PartMPNURL
{{ part.SKU }}{{ part.description }} - {% if part.part %} - {{ part.part.name }} - {% endif %} - - {% if part.manufacturer %}{{ part.manufacturer.name }}{% endif %} - {% if part.MPN %} | {{ part.MPN }}{% endif %} - {{ part.URL }}
- -
- - - - - - - - - -
- - {% endblock %} \ No newline at end of file diff --git a/InvenTree/company/templates/company/index.html b/InvenTree/company/templates/company/index.html index 90a8d0e9a5..a2c6a4bfbc 100644 --- a/InvenTree/company/templates/company/index.html +++ b/InvenTree/company/templates/company/index.html @@ -6,7 +6,7 @@ \ No newline at end of file