Skip to content

Commit

Permalink
fix: ignore mandatory when creating or updating tax witholding category
Browse files Browse the repository at this point in the history
(cherry picked from commit 493b5cb)
  • Loading branch information
vorasmit authored and mergify[bot] committed Mar 21, 2024
1 parent ce8e870 commit a36f89a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions india_compliance/income_tax_india/overrides/company.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ def create_or_update_tax_withholding_category(company):
"Account", {"account_name": "TDS Payable", "company": company}, "name"
)

ignore_mandatory = False
if not tds_account:
ignore_mandatory = True

if company and tds_account:
accounts.append({"company": company, "account": tds_account})

Expand All @@ -51,7 +47,7 @@ def create_or_update_tax_withholding_category(company):
)
if not existing_category_list:
doc = frappe.get_doc(category_doc)
doc.insert(ignore_if_duplicate=True, ignore_mandatory=ignore_mandatory)
doc.insert(ignore_if_duplicate=True, ignore_mandatory=True)

else:
for category_name in existing_category_list:
Expand Down Expand Up @@ -88,6 +84,9 @@ def update_existing_tax_withholding_category(category_doc, category_name, compan

doc.append("rates", cat_row)

# accounts table is mandatory
doc.flags.ignore_mandatory = True

doc.save()


Expand Down

0 comments on commit a36f89a

Please sign in to comment.