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>
This commit is contained in:
@@ -36,6 +36,16 @@ urlpatterns = [
|
||||
# API endpoints
|
||||
path('api/search-products-variants/', views.search_products_and_variants, name='api-search-products-variants'),
|
||||
|
||||
# CRUD URLs for ProductVariantGroup (Варианты товаров)
|
||||
path('variant-groups/', views.ProductVariantGroupListView.as_view(), name='variantgroup-list'),
|
||||
path('variant-groups/create/', views.ProductVariantGroupCreateView.as_view(), name='variantgroup-create'),
|
||||
path('variant-groups/<int:pk>/', views.ProductVariantGroupDetailView.as_view(), name='variantgroup-detail'),
|
||||
path('variant-groups/<int:pk>/update/', views.ProductVariantGroupUpdateView.as_view(), name='variantgroup-update'),
|
||||
path('variant-groups/<int:pk>/delete/', views.ProductVariantGroupDeleteView.as_view(), name='variantgroup-delete'),
|
||||
|
||||
# AJAX endpoints for ProductVariantGroup item management
|
||||
path('variant-groups/item/<int:item_id>/move/<str:direction>/', views.product_variant_group_item_move, name='variantgroup-item-move'),
|
||||
|
||||
# CRUD URLs for ProductCategory
|
||||
path('categories/', views.ProductCategoryListView.as_view(), name='category-list'),
|
||||
path('categories/create/', views.ProductCategoryCreateView.as_view(), name='category-create'),
|
||||
|
||||
Reference in New Issue
Block a user