organization limit for quota - get org childs

This commit is contained in:
2025-07-16 12:21:29 +03:30
parent a70d451ca1
commit a6b29ad28d
47 changed files with 375 additions and 11 deletions

View File

@@ -0,0 +1,69 @@
# Generated by Django 5.0 on 2025-07-16 07:41
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('authentication', '0026_organizationstats'),
('product', '0047_quotalivestockagelimitation_livestock_type'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.AddField(
model_name='quota',
name='has_organization_limit',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='quota',
name='limit_by_organizations',
field=models.ManyToManyField(null=True, related_name='quota_limits', to='authentication.organization'),
),
migrations.CreateModel(
name='ProductStats',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('create_date', models.DateTimeField(auto_now_add=True)),
('modify_date', models.DateTimeField(auto_now=True)),
('creator_info', models.CharField(max_length=100, null=True)),
('modifier_info', models.CharField(max_length=100, null=True)),
('trash', models.BooleanField(default=False)),
('total_quota', models.PositiveBigIntegerField(default=0)),
('total_remaining', models.PositiveBigIntegerField(default=0)),
('total_sold', models.PositiveBigIntegerField(default=0)),
('total_transactions', models.PositiveBigIntegerField(default=0)),
('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(class)s_createddby', to=settings.AUTH_USER_MODEL)),
('modified_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(class)s_modifiedby', to=settings.AUTH_USER_MODEL)),
('product', models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='stats', to='product.product')),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='QuotaStats',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('create_date', models.DateTimeField(auto_now_add=True)),
('modify_date', models.DateTimeField(auto_now=True)),
('creator_info', models.CharField(max_length=100, null=True)),
('modifier_info', models.CharField(max_length=100, null=True)),
('trash', models.BooleanField(default=False)),
('total_distributed', models.PositiveBigIntegerField(default=0)),
('remaining', models.PositiveBigIntegerField(default=0)),
('total_inventory', models.PositiveBigIntegerField(default=0)),
('total_sale', models.PositiveBigIntegerField(default=0)),
('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(class)s_createddby', to=settings.AUTH_USER_MODEL)),
('modified_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(class)s_modifiedby', to=settings.AUTH_USER_MODEL)),
('quota', models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='stats', to='product.quota')),
],
options={
'abstract': False,
},
),
]

View File

@@ -0,0 +1,19 @@
# Generated by Django 5.0 on 2025-07-16 07:43
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('authentication', '0026_organizationstats'),
('product', '0048_quota_has_organization_limit_and_more'),
]
operations = [
migrations.AlterField(
model_name='quota',
name='limit_by_organizations',
field=models.ManyToManyField(related_name='quota_limits', to='authentication.organization'),
),
]