add test setup_wizard_complete hook that creates TEST COMP salary component
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
24934219f1
commit
116efda4f2
|
|
@ -5,11 +5,19 @@ def create_test_salary_component(args):
|
|||
if frappe.db.exists("Salary Component", "TEST COMP"):
|
||||
return
|
||||
|
||||
company = args.get("company_name") or frappe.db.get_single_value("Global Defaults", "default_company")
|
||||
|
||||
doc = frappe.get_doc({
|
||||
"doctype": "Salary Component",
|
||||
"salary_component": "TEST COMP",
|
||||
"salary_component_abbr": "TC",
|
||||
"type": "Earning",
|
||||
"accounts": [
|
||||
{
|
||||
"company": company,
|
||||
"account": None, # можно указать конкретный счёт
|
||||
}
|
||||
] if company else [],
|
||||
})
|
||||
doc.insert(ignore_permissions=True)
|
||||
frappe.db.commit()
|
||||
|
|
|
|||
Loading…
Reference in New Issue