Связал склад и спецификацию
All checks were successful
Auto-Deploy-prodman / deploy (push) Successful in 6s

This commit is contained in:
2026-02-16 08:15:44 +03:00
parent 56dd6644e2
commit 785fed4b7f
3 changed files with 45 additions and 0 deletions

View File

@@ -3,6 +3,8 @@ from django.urls import reverse
from mptt.models import MPTTModel, TreeForeignKey
from polymorphic.models import PolymorphicModel
from django.core.exceptions import ValidationError
# импортируем модели из stock
from stock.models import BaseMaterial
# Create your models here.
# Базовая модель операции
@@ -210,7 +212,18 @@ class Item(models.Model):
# Технические данные
drawing = models.FileField("Чертеж", upload_to='drawings/', blank=True, null=True)
# Связь с заготовкой
material = models.ForeignKey(
'stock.BaseMaterial',
on_delete=models.SET_NULL,
null=True,
blank=True,
verbose_name="Материал заготовки",
related_name="items",
help_text="Выберите тип заготовки для этой детали"
)
weight = models.FloatField("Вес", default=0, blank=True, null=True)
class Meta:
verbose_name = "Компонент"