add new app

This commit is contained in:
behruz-dev
2025-08-01 15:24:00 +05:00
parent 9b403c46da
commit a714dbacb3
49 changed files with 579 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
# Generated by Django 5.2.4 on 2025-08-01 11:42
import django.db.models.deletion
import uuid
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('company', '0002_rename_barnch_branch'),
('products', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='WhereHouse',
fields=[
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('name', models.CharField(max_length=200)),
('address', models.CharField(max_length=200)),
('branch', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='wherehouses', to='company.branch')),
],
options={
'verbose_name': 'omborxona',
'verbose_name_plural': 'omborxonalar',
},
),
migrations.CreateModel(
name='Inventory',
fields=[
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('quantity', models.PositiveIntegerField(default=0)),
('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='inventories', to='products.product')),
('wherehouse', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='inventories', to='wherehouse.wherehouse')),
],
options={
'verbose_name': 'inventar',
'verbose_name_plural': 'inventarlar',
},
),
]

View File

@@ -0,0 +1,33 @@
# Generated by Django 5.2.4 on 2025-08-01 14:37
import django.db.models.deletion
import uuid
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('products', '0002_alter_product_options'),
('wherehouse', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='StockMovemend',
fields=[
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('quantity', models.PositiveIntegerField(default=0)),
('movemend_type', models.CharField(choices=[('IN', 'in'), ('OUT', 'out'), ('TRANSFER', 'transfer')], max_length=20)),
('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='stocks', to='products.product')),
('wherehouse_from', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='stocks_from', to='wherehouse.wherehouse')),
('wherehouse_to', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='stocks_to', to='wherehouse.wherehouse')),
],
options={
'verbose_name': 'Mahsulotlarni kochirish',
'verbose_name_plural': 'Mahsulotlarni kochirish',
},
),
]