Sith/accounting/migrations/0001_initial.py

73 lines
3.4 KiB
Python
Raw Normal View History

2016-01-28 15:53:37 +00:00
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
import accounting.models
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
2016-01-28 15:53:37 +00:00
]
operations = [
migrations.CreateModel(
name='Customer',
fields=[
2016-03-29 10:45:10 +00:00
('user', models.OneToOneField(to=settings.AUTH_USER_MODEL, serialize=False, primary_key=True)),
('account_id', models.CharField(max_length=10, verbose_name='account id', unique=True)),
2016-01-28 15:53:37 +00:00
],
options={
'verbose_name': 'customer',
2016-03-29 10:45:10 +00:00
'verbose_name_plural': 'customers',
2016-01-28 15:53:37 +00:00
},
),
migrations.CreateModel(
name='GeneralJournal',
fields=[
2016-03-29 10:45:10 +00:00
('id', models.AutoField(primary_key=True, serialize=False, verbose_name='ID', auto_created=True)),
2016-01-28 15:53:37 +00:00
('start_date', models.DateField(verbose_name='start date')),
2016-03-29 10:45:10 +00:00
('end_date', models.DateField(default=None, blank=True, null=True, verbose_name='end date')),
('name', models.CharField(max_length=30, verbose_name='name')),
2016-01-28 15:53:37 +00:00
('closed', models.BooleanField(default=False, verbose_name='is closed')),
],
),
migrations.CreateModel(
name='GenericInvoice',
fields=[
2016-03-29 10:45:10 +00:00
('id', models.AutoField(primary_key=True, serialize=False, verbose_name='ID', auto_created=True)),
('name', models.CharField(max_length=100, verbose_name='name')),
2016-03-29 10:45:10 +00:00
('journal', models.ForeignKey(to='accounting.GeneralJournal', related_name='invoices')),
2016-01-28 15:53:37 +00:00
],
),
migrations.CreateModel(
name='Product',
fields=[
2016-03-29 10:45:10 +00:00
('id', models.AutoField(primary_key=True, serialize=False, verbose_name='ID', auto_created=True)),
('name', models.CharField(max_length=30, verbose_name='name')),
('description', models.TextField(blank=True, verbose_name='description')),
('code', models.CharField(max_length=10, verbose_name='code')),
2016-03-29 10:45:10 +00:00
('purchase_price', accounting.models.CurrencyField(max_digits=12, verbose_name='purchase price', decimal_places=2)),
('selling_price', accounting.models.CurrencyField(max_digits=12, verbose_name='selling price', decimal_places=2)),
('special_selling_price', accounting.models.CurrencyField(max_digits=12, verbose_name='special selling price', decimal_places=2)),
('icon', models.ImageField(upload_to='products', blank=True, null=True)),
2016-01-28 15:53:37 +00:00
],
),
migrations.CreateModel(
name='ProductType',
fields=[
2016-03-29 10:45:10 +00:00
('id', models.AutoField(primary_key=True, serialize=False, verbose_name='ID', auto_created=True)),
('name', models.CharField(max_length=30, verbose_name='name')),
('description', models.TextField(blank=True, null=True, verbose_name='description')),
2016-03-29 10:45:10 +00:00
('icon', models.ImageField(upload_to='products', blank=True, null=True)),
2016-01-28 15:53:37 +00:00
],
),
migrations.AddField(
model_name='product',
name='product_type',
2016-03-29 10:45:10 +00:00
field=models.ForeignKey(blank=True, related_name='products', to='accounting.ProductType', null=True),
2016-01-28 15:53:37 +00:00
),
]