Disabled as it fucked with the return of Payment and Receipt as they had only one journal when sent to front end

This commit is contained in:
Amritanshu Agrawal 2020-05-30 11:11:52 +05:30
parent 2a86246e23
commit 0177921e84

View File

@ -164,12 +164,12 @@ class Voucher(VoucherIn):
return value
return datetime.strptime(value, "%d-%b-%Y").date()
@validator("journals")
def validate_enough_journals(cls, value: List[Journal]):
if 0 < len(value) < 2:
raise ValueError("Not enough journals")
return value
# @validator("journals")
# def validate_enough_journals(cls, value: List[Journal]):
# if 0 < len(value) < 2:
# raise ValueError("Not enough journals")
# return value
#
@validator("journals")
def validate_signed_amount(cls, value: List[Journal]):
if sum(x.debit * x.amount for x in value) != 0: