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 %} + +
Website | {{ company.website }} | +
Address | {{ company.address }} | +
Phone | {{ company.phone }} | +
{{ company.email }} | +|
Contact | {{ company.contact }} | +
SKU | -Description | -Parent Part | -MPN | -URL | -
---|---|---|---|---|
{{ 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 }} | -{% endfor %} -
{{ supplier.description }}
-{{ supplier.notes }}
-Website | {{ supplier.website }} | -
Address | {{ supplier.address }} | -
Phone | {{ supplier.phone }} | -
{{ supplier.email }} | -|
Contact | {{ supplier.contact }} | -