Add voucher-line party (تفصیل) and allow cache-control CORS headers.

Supports accounting journal detail parties and preflight from the Vite client that sends Cache-Control/Pragma.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Shayan Azadi
2026-08-04 19:21:37 +03:30
parent 29bb516ea9
commit 4c08ef4b21
4 changed files with 40 additions and 1 deletions

View File

@@ -137,6 +137,14 @@ class VoucherLine(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
voucher = models.ForeignKey(Voucher, on_delete=models.CASCADE, related_name='lines')
account = models.ForeignKey(Account, on_delete=models.PROTECT, related_name='voucher_lines')
# تفصیل / طرف حساب — who the line is with (optional for non-party accounts)
party = models.ForeignKey(
Party,
on_delete=models.SET_NULL,
null=True,
blank=True,
related_name='voucher_lines',
)
description = models.CharField(max_length=255, blank=True, default='')
debit = models.FloatField(default=0)
credit = models.FloatField(default=0)