Merge pull request #16645 from nabinhait/tds-fix
fix: Ignore tds account while creating tax withholding category
This commit is contained in:
commit
09a4df74f0
@ -345,13 +345,14 @@ def set_tax_withholding_category(company):
|
|||||||
if company and tds_account:
|
if company and tds_account:
|
||||||
accounts = [dict(company=company, account=tds_account)]
|
accounts = [dict(company=company, account=tds_account)]
|
||||||
|
|
||||||
fiscal_year = get_fiscal_year(today(), company=accounts[0].get('company'))[0]
|
fiscal_year = get_fiscal_year(today(), company=company)[0]
|
||||||
docs = get_tds_details(accounts, fiscal_year)
|
docs = get_tds_details(accounts, fiscal_year)
|
||||||
|
|
||||||
for d in docs:
|
for d in docs:
|
||||||
try:
|
try:
|
||||||
doc = frappe.get_doc(d)
|
doc = frappe.get_doc(d)
|
||||||
doc.flags.ignore_permissions = True
|
doc.flags.ignore_permissions = True
|
||||||
|
doc.flags.ignore_mandatory = True
|
||||||
doc.insert()
|
doc.insert()
|
||||||
except frappe.DuplicateEntryError:
|
except frappe.DuplicateEntryError:
|
||||||
doc = frappe.get_doc("Tax Withholding Category", d.get("name"))
|
doc = frappe.get_doc("Tax Withholding Category", d.get("name"))
|
||||||
|
Loading…
Reference in New Issue
Block a user