Files
octopus/ГИД ПО ЗАПУСКУ
Andrey Smakotin 6c8af5ab2c fix: Улучшения системы ценообразования комплектов
Исправлены 4 проблемы:
1. Расчёт цены первого товара - улучшена валидация в getProductPrice и calculateFinalPrice
2. Отображение actual_price в Select2 вместо обычной цены
3. Количество по умолчанию = 1 для новых форм компонентов
4. Auto-select текста при клике на поле количества для удобства редактирования

Изменённые файлы:
- products/forms.py: добавлен __init__ в KitItemForm для quantity.initial = 1
- products/templates/includes/select2-product-init.html: обновлена formatSelectResult
- products/templates/productkit_create.html: добавлен focus handler для auto-select
- products/templates/productkit_edit.html: добавлен focus handler для auto-select

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 19:04:03 +03:00

44 lines
1.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
docker run -d \
--name postgres17 \
-e POSTGRES_PASSWORD=postgres \
-e POSTGRES_USER=postgres \
-e POSTGRES_DB=inventory_db \
-p 5432:5432 \
-v postgres17-data:/var/lib/postgresql/data \
postgres:17
# 2. Создаем миграции с нуля
python manage.py makemigrations
# 3. Применяем все миграции
python manage.py migrate
# 4. Создаем главного тенанта (если нужно)
python manage.py shell
# Внутри shell:
from tenants.models import Client, Domain
client = Client.objects.create(
name='Main',
schema_name='public'
)
Domain.objects.create(
domain='localhost',
tenant=client,
is_primary=True
)
exit()
# 5. Создаем суперпользователя для public схемы
python manage.py createsuperuser
# 6. Создаем суперпользователя для конкретного тенанта (опционально)
python manage.py shell
# Внутри:
from tenants.models import Client
from django.core.management import call_command
from django_tenants.utils import schema_context
client = Client.objects.get(schema_name='public')
with schema_context(client):
call_command('createsuperuser')
exit()