add new fields to incentive assignment
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
# Generated by Django 5.0 on 2025-08-30 09:22
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('livestock', '0013_livestock_archive'),
|
||||
('product', '0070_alter_quotalivestockallocation_quantity_kg'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='quotaincentiveassignment',
|
||||
name='livestock_type',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='incentive_plans', to='livestock.livestocktype'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='quotaincentiveassignment',
|
||||
name='quantity_kg',
|
||||
field=models.PositiveBigIntegerField(default=0),
|
||||
),
|
||||
]
|
||||
@@ -449,6 +449,13 @@ class QuotaIncentiveAssignment(BaseModel):
|
||||
)
|
||||
heavy_value = models.PositiveBigIntegerField(default=0)
|
||||
light_value = models.PositiveBigIntegerField(default=0)
|
||||
livestock_type = models.ForeignKey(
|
||||
LiveStockType,
|
||||
on_delete=models.CASCADE,
|
||||
related_name='incentive_plans',
|
||||
null=True
|
||||
)
|
||||
quantity_kg = models.PositiveBigIntegerField(default=0)
|
||||
|
||||
def __str__(self):
|
||||
return f"Quota ({self.quota.id}) for {self.incentive_plan.name}"
|
||||
|
||||
Reference in New Issue
Block a user