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:
2020-05-30 11:11:52 +05:30
parent 2a86246e23
commit 0177921e84

View File

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