Remove direct reservation management from web interface

PROBLEM:
Direct deletion/creation of reservations via web interface bypassed
POS business logic, creating data inconsistencies (orphaned showcase kits,
incorrect stock calculations).

SOLUTION:
Make reservations read-only in web interface. All reservation management
now happens only through:
- POS (showcase kits)
- Orders module

CHANGES:
- Remove reservation-create and reservation-update URL routes
- Delete ReservationCreateView and ReservationUpdateView
- Remove ReservationForm (no longer needed)
- Delete reservation_form.html and reservation_update.html templates
- Update reservation_list.html to read-only view with info banner
- Add showcase and order columns to reservation list
- Clean up imports in urls.py and views/__init__.py

Reservations are now read-only for monitoring purposes only.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-20 13:17:04 +03:00
parent cd037e8f6b
commit 82261cbba7
7 changed files with 123 additions and 69 deletions

View File

@@ -104,24 +104,6 @@ class WriteOffForm(forms.ModelForm):
return cleaned_data
class ReservationForm(forms.ModelForm):
class Meta:
model = Reservation
fields = ['product', 'warehouse', 'quantity', 'order_item']
widgets = {
'product': forms.Select(attrs={'class': 'form-control'}),
'warehouse': forms.Select(attrs={'class': 'form-control'}),
'quantity': forms.NumberInput(attrs={'class': 'form-control', 'step': '0.001'}),
'order_item': forms.Select(attrs={'class': 'form-control'}),
}
def clean_quantity(self):
quantity = self.cleaned_data.get('quantity')
if quantity and quantity <= 0:
raise ValidationError('Количество должно быть больше нуля')
return quantity
class InventoryForm(forms.ModelForm):
class Meta:
model = Inventory