# Generated by Django 2.2.7 on 2019-11-28 12:29

from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import isc_common.fields.code_field
import isc_common.fields.name_field
import isc_common.fields.related


class Migration(migrations.Migration):

    dependencies = [
        ('ckk', '0161_auto_20191122_0920'),
        ('kd', '0085_auto_20191031_1745'),
        ('sales', '0120_tec_spc_item_refs'),
    ]

    operations = [
        migrations.AddField(
            model_name='tec_spc_item_refs',
            name='item_refs',
            field=isc_common.fields.related.ForeignKeyProtect(default=None, on_delete=django.db.models.deletion.PROTECT, to='ckk.Item_refs'),
        ),
        migrations.CreateModel(
            name='Tec_spc_item_line',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False, verbose_name='Идентификатор')),
                ('deleted_at', models.DateTimeField(blank=True, db_index=True, null=True, verbose_name='Дата мягкого удаления')),
                ('editing', models.BooleanField(default=True, verbose_name='Возможность редактирования')),
                ('deliting', models.BooleanField(default=True, verbose_name='Возможность удаления')),
                ('lastmodified', models.DateTimeField(db_index=True, default=django.utils.timezone.now, editable=False, verbose_name='Последнее обновление')),
                ('section', isc_common.fields.code_field.CodeStrictField()),
                ('section_num', models.PositiveIntegerField(blank=True, null=True)),
                ('subsection', isc_common.fields.name_field.NameField(blank=True, null=True)),
                ('SPC_CLM_COUNT', isc_common.fields.related.ForeignKeyProtect(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='SPC_CLM_COUNT_tec', to='kd.Document_attributes', verbose_name='Количество')),
                ('SPC_CLM_FACTORY', isc_common.fields.related.ForeignKeyProtect(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='SPC_CLM_FACTORY_tec', to='kd.Document_attributes', verbose_name='Предприятие - изготовитель')),
                ('SPC_CLM_FORMAT', isc_common.fields.related.ForeignKeyProtect(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='SPC_CLM_FORMAT_tec', to='kd.Document_attributes', verbose_name='Формат')),
                ('SPC_CLM_KOD', isc_common.fields.related.ForeignKeyProtect(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='SPC_CLM_KOD_tec', to='kd.Document_attributes', verbose_name='Код')),
                ('SPC_CLM_MARK', isc_common.fields.related.ForeignKeyProtect(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='SPC_CLM_MARK_tec', to='kd.Document_attributes', verbose_name='Обозначение')),
                ('SPC_CLM_MASSA', isc_common.fields.related.ForeignKeyProtect(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='SPC_CLM_MASSA_tec', to='kd.Document_attributes', verbose_name='Масса')),
                ('SPC_CLM_MATERIAL', isc_common.fields.related.ForeignKeyProtect(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='SPC_CLM_MATERIAL_tec', to='kd.Document_attributes', verbose_name='Материал')),
                ('SPC_CLM_NAME', isc_common.fields.related.ForeignKeyProtect(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='SPC_CLM_NAME_tec', to='kd.Document_attributes', verbose_name='Наименование')),
                ('SPC_CLM_NOTE', isc_common.fields.related.ForeignKeyProtect(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='SPC_CLM_NOTE_tec', to='kd.Document_attributes', verbose_name='Примечание')),
                ('SPC_CLM_POS', isc_common.fields.related.ForeignKeyProtect(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='SPC_CLM_POS_tec', to='kd.Document_attributes', verbose_name='Позиция')),
                ('SPC_CLM_USER', isc_common.fields.related.ForeignKeyProtect(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='SPC_CLM_USER_tec', to='kd.Document_attributes', verbose_name='Пользовательская')),
                ('SPC_CLM_ZONE', isc_common.fields.related.ForeignKeyProtect(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='SPC_CLM_ZONE_tec', to='kd.Document_attributes', verbose_name='Зона')),
                ('child', isc_common.fields.related.ForeignKeyProtect(on_delete=django.db.models.deletion.PROTECT, related_name='item_child_tec', to='ckk.Item', verbose_name='Товарная позиция')),
                ('item_line', isc_common.fields.related.ForeignKeyProtect(default=None, on_delete=django.db.models.deletion.PROTECT, to='ckk.Item_line')),
                ('parent', isc_common.fields.related.ForeignKeyProtect(on_delete=django.db.models.deletion.PROTECT, related_name='item_parent_tec', to='ckk.Item', verbose_name='Товарная позиция')),
            ],
            options={
                'verbose_name': 'Строка состава изделия',
                'ordering': ['section'],
                'unique_together': {('parent', 'child')},
            },
        ),
    ]
