fix: failing tests fixed

(cherry picked from commit 2ce07865d3)
This commit is contained in:
vishakhdesai
2024-12-19 12:55:11 +05:30
committed by Mergify
parent 944dc966bc
commit 61367ee1ed

View File

@@ -485,7 +485,7 @@ def subtract_allocations(gl_account, vouchers):
voucher_allocated_amounts = get_total_allocated_amount(voucher_docs)
for voucher in vouchers:
rows = voucher_allocated_amounts.get((voucher.get("doctype"), voucher.get("name")))
rows = voucher_allocated_amounts.get((voucher.get("doctype"), voucher.get("name"))) or []
filtered_row = list(filter(lambda row: row.get("gl_account") == gl_account, rows))
if amount := None if not filtered_row else filtered_row[0]["total"]: