From e7e269d4a470a076a4fe786d6828fcfc89b94b3e Mon Sep 17 00:00:00 2001 From: Shreya Shah Date: Sat, 6 Oct 2018 17:56:21 +0530 Subject: [PATCH] [Error] Display appropriate msg if company is different for TDS (#15601) * fix(tds): Display appropriate msg if company is different * Update tax_withholding_category.py --- .../tax_withholding_category/tax_withholding_category.py | 3 +++ 1 file changed, 3 insertions(+) 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 9a2c0955166..f553cc09eca 100644 --- a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py +++ b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py @@ -19,6 +19,9 @@ def get_party_tax_withholding_details(ref_doc): fy = get_fiscal_year(ref_doc.posting_date, company=ref_doc.company) tax_details = get_tax_withholding_details(tax_withholding_category, fy[0], ref_doc.company) + if not tax_details: + frappe.throw(_('Please set associated account in Tax Withholding Category {0} against Company {1}') + .format(tax_withholding_category, ref_doc.company)) tds_amount = get_tds_amount(ref_doc, tax_details, fy) tax_row = get_tax_row(tax_details, tds_amount) return tax_row