feat: Add SKU field to ProductKit form for kit creation

- Added 'sku' field to ProductKitForm meta fields list
- Added SKU label in form labels
- Added SKU widget styling in __init__ method with helpful placeholder
- Updated productkit_form.html template to display SKU field after name, before description
- Updated form field filtering to exclude 'sku' from dynamic loop to prevent duplication

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-10-22 16:39:49 +03:00
parent b910ae6a6b
commit 70f05abdb9
2 changed files with 19 additions and 2 deletions

View File

@@ -82,11 +82,12 @@ class ProductKitForm(forms.ModelForm):
class Meta:
model = ProductKit
fields = [
'name', 'description', 'categories',
'name', 'sku', 'description', 'categories',
'tags', 'pricing_method', 'fixed_price', 'markup_percent', 'markup_amount', 'is_active'
]
labels = {
'name': 'Название',
'sku': 'Артикул',
'description': 'Описание',
'categories': 'Категории',
'tags': 'Теги',
@@ -104,6 +105,10 @@ class ProductKitForm(forms.ModelForm):
'class': 'form-control',
'placeholder': 'Введите название комплекта'
})
self.fields['sku'].widget.attrs.update({
'class': 'form-control',
'placeholder': 'Артикул (необязательно, будет сгенерирован автоматически)'
})
self.fields['description'].widget.attrs.update({
'class': 'form-control',
'rows': 3