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:
parent
2a86246e23
commit
0177921e84
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user