From 86b2e28eaf5e9cb1ffcd6da8c46ba8ebbf15ac73 Mon Sep 17 00:00:00 2001 From: harshpwctech <84438948+harshpwctech@users.noreply.github.com> Date: Fri, 21 Feb 2025 16:01:33 +0530 Subject: [PATCH] Update tax_withholding_category.py to fix the query function. The journal_entries_details in get_invoice_vouchers function is supposed to return dict. Resolves: https://github.com/frappe/erpnext/issues/46050 --- .../tax_withholding_category.py | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py index 06549973242f..da2ee75fd714 100644 --- a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py +++ b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py @@ -436,20 +436,22 @@ def get_invoice_vouchers(parties, tax_details, company, party_type="Supplier"): tax_details.get("tax_withholding_category"), company, ), + as_dict=1, ) - for d in journal_entries_details: - vouchers.append(d.name) - voucher_wise_amount.append( - frappe._dict( - { - "voucher_name": d.name, - "voucher_type": "Journal Entry", - "taxable_amount": d.amount, - "reference_type": d.reference_type, - } + if journal_entries_details: + for d in journal_entries_details: + vouchers.append(d.name) + voucher_wise_amount.append( + frappe._dict( + { + "voucher_name": d.name, + "voucher_type": "Journal Entry", + "taxable_amount": d.amount, + "reference_type": d.reference_type, + } + ) ) - ) return vouchers, voucher_wise_amount