add party model

This commit is contained in:
behruz-dev
2025-08-21 10:17:59 +05:00
parent 15ef725e91
commit 7e2e62d48c
6 changed files with 104 additions and 2 deletions

View File

@@ -0,0 +1,25 @@
from django.db import models
from core.apps.shared.models import BaseModel
from core.apps.orders.models.order import Order
from core.apps.accounts.models import User
class Party(BaseModel):
orders = models.ManyToManyField(Order, related_name='parties', null=True, blank=True)
mediator = models.ForeignKey(User, on_delete=models.CASCADE, related_name='parties')
delivery_date = models.DateField()
payment_date = models.DateField()
comment = models.TextField(null=True, blank=True)
audit = models.CharField(
max_length=20, choices=[('CHECKED', 'tekshirildi'),('PROCESS', 'jarayonda')],
null=True, blank=True
)
audit_comment = models.TextField(null=True, blank=True)
def __str__(self):
return f'{self.mediator.full_name} {self.delivery_date}'
class Meta:
verbose_name = 'Partiya'
verbose_name_plural = 'Partiyalar'