Конкретно пересмотрел логику работы. Легаси вынесена в архив
All checks were successful
Deploy MES Core / deploy (push) Successful in 13s
All checks were successful
Deploy MES Core / deploy (push) Successful in 13s
This commit is contained in:
18
warehouse/migrations/0014_material_mass_per_unit.py
Normal file
18
warehouse/migrations/0014_material_mass_per_unit.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 6.0.3 on 2026-04-07 17:04
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('warehouse', '0013_stockitem_archived_at_stockitem_is_archived'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='material',
|
||||
name='mass_per_unit',
|
||||
field=models.FloatField(blank=True, null=True, verbose_name='Масса на ед. учёта'),
|
||||
),
|
||||
]
|
||||
@@ -43,6 +43,7 @@ class Material(models.Model):
|
||||
steel_grade = models.ForeignKey(SteelGrade, on_delete=models.PROTECT, verbose_name="Марка стали", null=True, blank=True)
|
||||
name = models.CharField("Наименование (размер/характеристики)", max_length=255)
|
||||
full_name = models.CharField("Полное наименование", max_length=500, blank=True, help_text="Генерируется автоматически")
|
||||
mass_per_unit = models.FloatField("Масса на ед. учёта", null=True, blank=True)
|
||||
|
||||
class Meta:
|
||||
verbose_name = "Материал (номенклатура)"
|
||||
|
||||
@@ -57,9 +57,11 @@ def receive_transfer(transfer_id: int, receiver_id: int) -> None:
|
||||
StockItem.objects.create(
|
||||
material=src.material,
|
||||
entity=src.entity,
|
||||
deal=src.deal,
|
||||
location_id=tr.to_location_id,
|
||||
quantity=float(ln.quantity),
|
||||
is_remnant=src.is_remnant,
|
||||
is_customer_supplied=src.is_customer_supplied,
|
||||
current_length=src.current_length,
|
||||
current_width=src.current_width,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user