add - WarehouseAllocationService

This commit is contained in:
2025-11-18 16:51:34 +03:30
parent 23e927a631
commit 4bf900a1e2
7 changed files with 152 additions and 2 deletions

View File

@@ -59,6 +59,25 @@ class InventoryEntry(BaseModel):
super(InventoryEntry, self).save(*args, **kwargs)
class InventoryEntryAllocation(BaseModel):
inventory_entry = models.ForeignKey(
InventoryEntry,
on_delete=models.CASCADE,
related_name='allocations',
null=True
)
distribution = models.ForeignKey(
product_models.QuotaDistribution,
on_delete=models.CASCADE,
related_name='allocations',
null=True
)
weight = models.PositiveBigIntegerField(default=0)
def __str__(self):
return f"{self.weight} -> Distribution {self.distribution.id}"
class InventoryQuotaSaleTransaction(BaseModel):
rancher = models.ForeignKey(
Rancher,