Remove unused code (#14526)

This commit is contained in:
Shreya Shah 2018-06-14 17:57:39 +05:30 committed by Nabin Hait
parent 02575d1f2c
commit 0b9b8d6826
2 changed files with 1 additions and 6 deletions

View File

@ -7,7 +7,4 @@ import frappe
from frappe.model.document import Document from frappe.model.document import Document
class TaxWithholdingCategory(Document): class TaxWithholdingCategory(Document):
def validate(self): pass
if not frappe.db.get_value("Tax Withholding Category",
{"is_default": 1, "name": ("!=", self.name)}, "name"):
self.is_default = 1

View File

@ -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): def set_tax_withholding_details(tax_mapper, ref_doc, tax_withholding_category=None, use_default=0):
if tax_withholding_category: if tax_withholding_category:
tax_withholding = frappe.get_doc("Tax Withholding Category", 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' \ 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'): or tax_withholding.book_on_advance and ref_doc.doctype in ('Payment Entry', 'Journal Entry'):