Moved "Customer" to CustomerOrders models

This commit is contained in:
Oliver 2018-04-17 23:24:19 +10:00
parent b547f6b309
commit 05cb2fe167
2 changed files with 55 additions and 1 deletions

View File

@ -0,0 +1,48 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-04-17 13:23
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('customer_orders', '0002_auto_20180417_2205'),
]
operations = [
migrations.CreateModel(
name='Customer',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100, unique=True)),
('description', models.CharField(max_length=500)),
('website', models.URLField(blank=True)),
('address', models.CharField(blank=True, max_length=200)),
('phone', models.CharField(blank=True, max_length=50)),
('email', models.EmailField(blank=True, max_length=254)),
('contact', models.CharField(blank=True, max_length=100)),
('notes', models.CharField(blank=True, max_length=500)),
],
options={
'abstract': False,
},
),
migrations.AlterField(
model_name='customerorder',
name='customer',
field=models.ForeignKey(blank=True, help_text=b'Customer that placed this order', null=True, on_delete=django.db.models.deletion.SET_NULL, to='customer_orders.Customer'),
),
migrations.AlterField(
model_name='customerorderline',
name='part',
field=models.ForeignKey(blank=True, help_text=b'Part', on_delete=django.db.models.deletion.CASCADE, to='part.Part'),
),
migrations.AlterField(
model_name='customerorderline',
name='quantity',
field=models.PositiveIntegerField(blank=True, help_text=b'Quantity of part'),
),
]

View File

@ -1,11 +1,17 @@
from django.db import models
from supplier.models import Customer
from InvenTree.models import Company
from part.models import Part
import datetime
class Customer(Company):
""" Represents a customer
"""
pass
class CustomerOrder(models.Model):
"""
An order from a customer, made up of multiple 'lines'