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>
26 lines
1.0 KiB
Python
26 lines
1.0 KiB
Python
# -*- coding: utf-8 -*-
|
||
"""
|
||
Reservation (Резервирование товара) views - READ ONLY
|
||
Резервы управляются только через POS и Orders
|
||
"""
|
||
from django.views.generic import ListView
|
||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||
from ..models import Reservation
|
||
|
||
|
||
class ReservationListView(LoginRequiredMixin, ListView):
|
||
"""
|
||
Список резервирований (только для просмотра).
|
||
Управление резервами происходит через POS (витринные комплекты) и Orders.
|
||
"""
|
||
model = Reservation
|
||
template_name = 'inventory/reservation/reservation_list.html'
|
||
context_object_name = 'reservations'
|
||
paginate_by = 20
|
||
|
||
def get_queryset(self):
|
||
"""Показываем все резервы со статусом 'reserved'"""
|
||
return Reservation.objects.filter(
|
||
status='reserved'
|
||
).select_related('product', 'warehouse', 'order_item', 'showcase').order_by('-reserved_at')
|