without herd rancher temporary livestocks in pos - complete
This commit is contained in:
@@ -98,3 +98,24 @@ class LiveStock(BaseModel):
|
||||
def save(self, *args, **kwargs):
|
||||
return super(LiveStock, self).save(*args, **kwargs)
|
||||
|
||||
|
||||
class TemporaryLiveStock(BaseModel):
|
||||
rancher = models.ForeignKey(
|
||||
herd_models.Rancher,
|
||||
on_delete=models.CASCADE,
|
||||
related_name='temporary_stocks',
|
||||
null=True
|
||||
)
|
||||
livestock_type = models.ForeignKey(
|
||||
LiveStockType,
|
||||
on_delete=models.CASCADE,
|
||||
related_name='temporary_stocks',
|
||||
null=True
|
||||
)
|
||||
count = models.PositiveBigIntegerField(default=0)
|
||||
|
||||
def __str__(self):
|
||||
return f'temporary: {self.id} - rancher: {self.rancher.national_code}'
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
return super(TemporaryLiveStock, self).save(*args, **kwargs)
|
||||
|
||||
Reference in New Issue
Block a user