Feature: справочник Статусы заказов, поле Статус в заказе клиента, оформление в списке (зелёный/песочный)

Made-with: Cursor
This commit is contained in:
2026-02-26 16:44:39 +00:00
parent 9d1bfadb96
commit 29cf44e278
15 changed files with 151 additions and 4 deletions

View File

@@ -4,7 +4,7 @@ from decimal import Decimal
from django.db import models
from django.db.models import Sum
from django.core.validators import MinValueValidator, MaxValueValidator
from references.models import Currency, OrderKind, Client, Organization, Supplier, Employee, CashAccount, Product
from references.models import Currency, OrderKind, Client, Organization, Supplier, Employee, CashAccount, Product, OrderStatus
class CustomerOrder(models.Model):
date = models.DateField("Дата")
@@ -12,6 +12,14 @@ class CustomerOrder(models.Model):
order_kind = models.ForeignKey(OrderKind, on_delete=models.PROTECT, verbose_name="Вид заказа")
organization = models.ForeignKey(Organization, on_delete=models.PROTECT, verbose_name="Организация")
client = models.ForeignKey(Client, on_delete=models.PROTECT, verbose_name="Клиент")
status = models.ForeignKey(
OrderStatus,
on_delete=models.PROTECT,
verbose_name="Статус заказа",
null=True,
blank=True,
related_name="customer_orders",
)
total_amount = models.DecimalField("Стоимость заказа", max_digits=18, decimal_places=2, default=Decimal("0"), editable=False)
author = models.ForeignKey(Employee, on_delete=models.SET_NULL, null=True, blank=True, verbose_name="Автор", related_name="customer_orders")
class Meta: