fix: party type and party mandatory on updating outstanding

This commit is contained in:
ruthra kumar 2022-10-18 09:33:37 +05:30
parent d794b834fd
commit 43b80683eb

View File

@ -1467,7 +1467,12 @@ def update_voucher_outstanding(voucher_type, voucher_no, account, party_type, pa
# on cancellation outstanding can be an empty list
voucher_outstanding = ple_query.get_voucher_outstandings(vouchers, common_filter=common_filter)
if voucher_type in ["Sales Invoice", "Purchase Invoice", "Fees"] and voucher_outstanding:
if (
voucher_type in ["Sales Invoice", "Purchase Invoice", "Fees"]
and party_type
and party
and voucher_outstanding
):
outstanding = voucher_outstanding[0]
ref_doc = frappe.get_doc(voucher_type, voucher_no)