added test salary component create

This commit is contained in:
Ali 2026-03-26 14:19:38 +04:00
parent b8b111b74a
commit 24934219f1
2 changed files with 16 additions and 0 deletions

View File

@ -80,6 +80,8 @@ doc_events = {
# Asset categories are now created automatically via Company.on_update event
# setup_wizard_complete = "jey_erp.setup.setup_wizard_handler.setup_wizard_complete_handler"
setup_wizard_complete = "jey_erp.setup.setup_wizard_handler.create_test_salary_component"
after_migrate = "jey_erp.hooks.after_migrate_combined"
def after_migrate_combined():

View File

@ -1,6 +1,20 @@
import frappe
def create_test_salary_component(args):
if frappe.db.exists("Salary Component", "TEST COMP"):
return
doc = frappe.get_doc({
"doctype": "Salary Component",
"salary_component": "TEST COMP",
"salary_component_abbr": "TC",
"type": "Earning",
})
doc.insert(ignore_permissions=True)
frappe.db.commit()
def setup_wizard_complete_handler(args):
"""
Вызывается после завершения ERPNext setup wizard.