delete default HRMS salary components on setup wizard complete

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ali 2026-03-26 15:03:42 +04:00
parent 6f17b644f2
commit 989cce52b4
1 changed files with 7 additions and 0 deletions

View File

@ -10,6 +10,9 @@ SALARY_COMPONENTS_JSON = os.path.join(
) )
HRMS_DEFAULT_COMPONENTS = ["Basic", "Arrear", "Leave Encashment", "Income Tax"]
def create_default_salary_components(args): def create_default_salary_components(args):
if not os.path.exists(SALARY_COMPONENTS_JSON): if not os.path.exists(SALARY_COMPONENTS_JSON):
return return
@ -29,6 +32,10 @@ def create_default_salary_components(args):
frappe.get_doc(data).insert(ignore_permissions=True) frappe.get_doc(data).insert(ignore_permissions=True)
for name in HRMS_DEFAULT_COMPONENTS:
if frappe.db.exists("Salary Component", name):
frappe.delete_doc("Salary Component", name, ignore_permissions=True)
frappe.db.commit() frappe.db.commit()