# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-02-16 13:44
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ('codenerix_invoicing', '0013_salesorderdocument_removed'),
        ('codenerix_products', '0011_auto_20180202_0826'),
        ('codenerix_storages', '0012_inventory_kind'),
    ]

    operations = [
        migrations.CreateModel(
            name='InventoryIn',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Created')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='Updated')),
                ('end', models.DateTimeField(blank=True, editable=False, null=True, verbose_name='Ends')),
                ('provider', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='inventorys', to='codenerix_invoicing.Provider', verbose_name='Provider')),
            ],
            options={
                'abstract': False,
                'default_permissions': ('add', 'change', 'delete', 'view', 'list'),
            },
        ),
        migrations.CreateModel(
            name='InventoryInLine',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Created')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='Updated')),
                ('product_unique_value', models.CharField(blank=True, default=None, editable=False, max_length=80, null=True, verbose_name='Product Unique Value')),
                ('quantity', models.FloatField(default=1.0, verbose_name='Quantity')),
                ('caducity', models.DateField(blank=True, default=None, null=True, verbose_name='Caducity')),
                ('box', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='storage_inventoryinline', to='codenerix_storages.StorageBox', verbose_name='Box')),
                ('inventory', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='inventory_lines', to='codenerix_storages.InventoryIn', verbose_name='Inventory line')),
                ('operator', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='storage_inventoryinline', to='codenerix_storages.StorageOperator', verbose_name='Storage Operator')),
                ('product_final', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='storage_inventoryinline', to='codenerix_products.ProductFinal', verbose_name='Product Final')),
                ('product_unique', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='storage_inventoryinline', to='codenerix_products.ProductUnique', verbose_name='Product Unique')),
            ],
            options={
                'abstract': False,
                'default_permissions': ('add', 'change', 'delete', 'view', 'list'),
            },
        ),
        migrations.CreateModel(
            name='InventoryOut',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Created')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='Updated')),
                ('end', models.DateTimeField(blank=True, editable=False, null=True, verbose_name='Ends')),
                ('order', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='inventorys', to='codenerix_invoicing.SalesOrder', verbose_name='Order')),
            ],
            options={
                'abstract': False,
                'default_permissions': ('add', 'change', 'delete', 'view', 'list'),
            },
        ),
        migrations.CreateModel(
            name='InventoryOutLine',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Created')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='Updated')),
                ('product_unique_value', models.CharField(blank=True, default=None, editable=False, max_length=80, null=True, verbose_name='Product Unique Value')),
                ('quantity', models.FloatField(default=1.0, verbose_name='Quantity')),
                ('box', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='storage_inventoryoutline', to='codenerix_storages.StorageBox', verbose_name='Box')),
                ('inventory', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='inventory_lines', to='codenerix_storages.InventoryOut', verbose_name='Inventory line')),
                ('operator', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='storage_inventoryoutline', to='codenerix_storages.StorageOperator', verbose_name='Storage Operator')),
                ('product_final', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='storage_inventoryoutline', to='codenerix_products.ProductFinal', verbose_name='Product Final')),
                ('product_unique', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='storage_inventoryoutline', to='codenerix_products.ProductUnique', verbose_name='Product Unique')),
            ],
            options={
                'abstract': False,
                'default_permissions': ('add', 'change', 'delete', 'view', 'list'),
            },
        ),
        migrations.RemoveField(
            model_name='inventory',
            name='kind',
        ),
        migrations.RemoveField(
            model_name='inventory',
            name='name',
        ),
        migrations.RemoveField(
            model_name='inventory',
            name='start',
        ),
        migrations.AlterField(
            model_name='inventory',
            name='end',
            field=models.DateTimeField(blank=True, editable=False, null=True, verbose_name='Ends'),
        ),
        migrations.AlterField(
            model_name='inventoryline',
            name='box',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='storage_inventoryline', to='codenerix_storages.StorageBox', verbose_name='Box'),
        ),
        migrations.AlterField(
            model_name='inventoryline',
            name='operator',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='storage_inventoryline', to='codenerix_storages.StorageOperator', verbose_name='Storage Operator'),
        ),
        migrations.AlterField(
            model_name='inventoryline',
            name='product_final',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='storage_inventoryline', to='codenerix_products.ProductFinal', verbose_name='Product Final'),
        ),
        migrations.AlterField(
            model_name='inventoryline',
            name='product_unique',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='storage_inventoryline', to='codenerix_products.ProductUnique', verbose_name='Product Unique'),
        ),
    ]
