fix(products): improve bulk category modal behavior and initialization
- Move default date initialization from form to view initial data - Add checks for DOM elements existence before event listener attachment - Handle 'clear' mode in bulk category modal with confirmation and API call - Improve CSRF token usage and error handling during bulk update requests - Remove deprecated handleClearAll function and integrate logic into handleApply - Reset modal state properly including input fields and radio button modes - Update modal JS file version reference in products list template
This commit is contained in:
@@ -356,11 +356,6 @@ class IncomingDocumentForm(forms.ModelForm):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.fields['warehouse'].queryset = Warehouse.objects.filter(is_active=True)
|
||||
|
||||
# Устанавливаем дату по умолчанию - сегодня
|
||||
if not self.initial.get('date'):
|
||||
from django.utils import timezone
|
||||
self.initial['date'] = timezone.now().date()
|
||||
|
||||
# Если есть склад по умолчанию - предвыбираем его
|
||||
if not self.initial.get('warehouse'):
|
||||
default_warehouse = Warehouse.objects.filter(
|
||||
|
||||
Reference in New Issue
Block a user