From 24934219f13861ebb9d87cb721c2b7f9413846f2 Mon Sep 17 00:00:00 2001 From: Ali <010109ali@gmail.com> Date: Thu, 26 Mar 2026 14:19:38 +0400 Subject: [PATCH] added test salary component create --- jey_erp/hooks.py | 2 ++ jey_erp/setup/setup_wizard_handler.py | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/jey_erp/hooks.py b/jey_erp/hooks.py index cbec3ca..98bf06b 100644 --- a/jey_erp/hooks.py +++ b/jey_erp/hooks.py @@ -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(): diff --git a/jey_erp/setup/setup_wizard_handler.py b/jey_erp/setup/setup_wizard_handler.py index 39626d8..441536a 100644 --- a/jey_erp/setup/setup_wizard_handler.py +++ b/jey_erp/setup/setup_wizard_handler.py @@ -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.