Fix: Kots should be sorted by date as a relationship of the voucher. This was causing them to appear in random order in sales.

This commit is contained in:
2021-06-22 05:34:02 +05:30
parent 1c222872d2
commit 567fb836b3
4 changed files with 22 additions and 29 deletions

View File

@ -13,6 +13,7 @@ from sqlalchemy import (
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.orm import relationship
from .kot import Kot
from .meta import Base
from .voucher_type import VoucherType
@ -51,6 +52,7 @@ class Voucher(Base):
backref="voucher",
cascade="delete, delete-orphan",
cascade_backrefs=False,
order_by=Kot.date,
)
settlements = relationship(
"Settlement",