delete default HRMS salary components on setup wizard complete
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
6f17b644f2
commit
989cce52b4
|
|
@ -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):
|
||||
if not os.path.exists(SALARY_COMPONENTS_JSON):
|
||||
return
|
||||
|
|
@ -29,6 +32,10 @@ def create_default_salary_components(args):
|
|||
|
||||
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()
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue