From 0b9b8d68266f013b8aab7b595d380dcb36ded33f Mon Sep 17 00:00:00 2001 From: Shreya Shah Date: Thu, 14 Jun 2018 17:57:39 +0530 Subject: [PATCH] Remove unused code (#14526) --- .../tax_withholding_category/tax_withholding_category.py | 5 +---- erpnext/accounts/party.py | 2 -- 2 files changed, 1 insertion(+), 6 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 61f4b60c8b..90c7d50a5a 100644 --- a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py +++ b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py @@ -7,7 +7,4 @@ import frappe from frappe.model.document import Document class TaxWithholdingCategory(Document): - def validate(self): - if not frappe.db.get_value("Tax Withholding Category", - {"is_default": 1, "name": ("!=", self.name)}, "name"): - self.is_default = 1 \ No newline at end of file + pass \ No newline at end of file diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py index 1db6ced2c5..909856ceaa 100644 --- a/erpnext/accounts/party.py +++ b/erpnext/accounts/party.py @@ -529,8 +529,6 @@ def prepare_tax_withholding_details(tax_mapper, tax_withholding_details): def set_tax_withholding_details(tax_mapper, ref_doc, tax_withholding_category=None, use_default=0): if tax_withholding_category: tax_withholding = frappe.get_doc("Tax Withholding Category", tax_withholding_category) - else: - tax_withholding = frappe.get_doc("Tax Withholding Category", {'is_default': 1, 'enabled': 1}) if tax_withholding.book_on_invoice and ref_doc.doctype=='Purchase Invoice' \ or tax_withholding.book_on_advance and ref_doc.doctype in ('Payment Entry', 'Journal Entry'):