Files
octopus/myproject/inventory/views/reservation.py
Andrey Smakotin 82261cbba7 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>
2025-11-20 13:17:04 +03:00

26 lines
1.0 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# -*- 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')