Упрощена логика системы путём замены отдельной сущности "Магазин" на универсальную сущность "Склад", которая может использоваться как точка самовывоза. Изменения: - Расширена модель Warehouse: добавлены адрес, контакты, флаг is_pickup_point - Модель Order: поле pickup_shop заменено на pickup_warehouse - Обновлены все формы, сервисы, views, admin для работы со складами - Обновлены шаблоны HTML и JavaScript код - Удалено приложение shops полностью - Пересозданы миграции БД - Обновлён навбар (удалена ссылка на магазины) Преимущества: - Упрощена архитектура системы - Единая точка управления складами и точками самовывоза - Интеграция с системой инвентаризации 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
124 lines
5.4 KiB
Python
124 lines
5.4 KiB
Python
# Generated by Django 5.0.10 on 2025-11-14 20:45
|
|
|
|
import django.db.models.deletion
|
|
from django.conf import settings
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
('orders', '0001_initial'),
|
|
('products', '0001_initial'),
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
]
|
|
|
|
operations = [
|
|
migrations.AddField(
|
|
model_name='orderitem',
|
|
name='product',
|
|
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='order_items', to='products.product', verbose_name='Товар'),
|
|
),
|
|
migrations.AddField(
|
|
model_name='orderitem',
|
|
name='product_kit',
|
|
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='order_items', to='products.productkit', verbose_name='Комплект товаров'),
|
|
),
|
|
migrations.AddField(
|
|
model_name='orderstatus',
|
|
name='created_by',
|
|
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='created_order_statuses', to=settings.AUTH_USER_MODEL, verbose_name='Создано'),
|
|
),
|
|
migrations.AddField(
|
|
model_name='orderstatus',
|
|
name='updated_by',
|
|
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='updated_order_statuses', to=settings.AUTH_USER_MODEL, verbose_name='Последнее изменение'),
|
|
),
|
|
migrations.AddField(
|
|
model_name='order',
|
|
name='status',
|
|
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='orders', to='orders.orderstatus', verbose_name='Статус заказа'),
|
|
),
|
|
migrations.AddField(
|
|
model_name='historicalorder',
|
|
name='status',
|
|
field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='orders.orderstatus', verbose_name='Статус заказа'),
|
|
),
|
|
migrations.AddField(
|
|
model_name='payment',
|
|
name='created_by',
|
|
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='payments_created', to=settings.AUTH_USER_MODEL, verbose_name='Принял платеж'),
|
|
),
|
|
migrations.AddField(
|
|
model_name='payment',
|
|
name='order',
|
|
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='payments', to='orders.order', verbose_name='Заказ'),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name='orderitem',
|
|
index=models.Index(fields=['order'], name='orders_orde_order_i_5d347b_idx'),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name='orderitem',
|
|
index=models.Index(fields=['product'], name='orders_orde_product_32ff41_idx'),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name='orderitem',
|
|
index=models.Index(fields=['product_kit'], name='orders_orde_product_925b51_idx'),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name='orderstatus',
|
|
index=models.Index(fields=['code'], name='orders_orde_code_5e1ef7_idx'),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name='orderstatus',
|
|
index=models.Index(fields=['is_system'], name='orders_orde_is_syst_2f5b85_idx'),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name='orderstatus',
|
|
index=models.Index(fields=['order'], name='orders_orde_order_2e2930_idx'),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name='order',
|
|
index=models.Index(fields=['customer'], name='orders_orde_custome_59b6fb_idx'),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name='order',
|
|
index=models.Index(fields=['status'], name='orders_orde_status__eb4f00_idx'),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name='order',
|
|
index=models.Index(fields=['delivery_date'], name='orders_orde_deliver_e4274f_idx'),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name='order',
|
|
index=models.Index(fields=['is_delivery'], name='orders_orde_is_deli_07c9c0_idx'),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name='order',
|
|
index=models.Index(fields=['payment_status'], name='orders_orde_payment_bc131d_idx'),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name='order',
|
|
index=models.Index(fields=['created_at'], name='orders_orde_created_0e92de_idx'),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name='order',
|
|
index=models.Index(fields=['order_number'], name='orders_orde_order_n_f3ada5_idx'),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name='order',
|
|
index=models.Index(fields=['is_custom_delivery_cost'], name='orders_orde_is_cust_108e98_idx'),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name='payment',
|
|
index=models.Index(fields=['order'], name='orders_paym_order_i_8c8d98_idx'),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name='payment',
|
|
index=models.Index(fields=['payment_date'], name='orders_paym_payment_9e5ac0_idx'),
|
|
),
|
|
]
|