counterparty: add counterpart

This commit is contained in:
behruz-dev
2025-10-31 16:02:08 +05:00
parent 31f894d0ff
commit 01fac3110e
14 changed files with 12474 additions and 34859 deletions

View File

@@ -0,0 +1,18 @@
# Generated by Django 5.2.4 on 2025-10-31 15:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('orders', '0030_alter_order_wherehouse_alter_party_status'),
]
operations = [
migrations.AddField(
model_name='order',
name='type',
field=models.CharField(choices=[('order', 'order'), ('party', 'party')], default='order', max_length=6),
),
]

View File

@@ -1,3 +1,3 @@
from .order import *
from .order_offer import *
from ..order_offer import *
from .party import *

View File

@@ -16,7 +16,7 @@ class Order(BaseModel):
('CANCELLED', "bekor qilindi"),
('ACCEPTED', 'qabul qilindi'),
)
type = models.CharField(max_length=6, choices=[('order', 'order'), ('party', 'party')], default='order')
product = models.ForeignKey(
Product, on_delete=models.CASCADE, related_name='orders'
)