feat: add employee number to client user bootinfo (#38477)

This commit is contained in:
Richard Case 2023-12-06 15:18:13 +00:00 committed by GitHub
parent d34787cf6d
commit 525f656cc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -637,6 +637,7 @@ additional_timeline_content = {
extend_bootinfo = [
"erpnext.support.doctype.service_level_agreement.service_level_agreement.add_sla_doctypes",
"erpnext.startup.boot.bootinfo",
]

View File

@ -75,3 +75,11 @@ def update_page_info(bootinfo):
"Sales Person Tree": {"title": "Sales Person Tree", "route": "Tree/Sales Person"},
}
)
def bootinfo(bootinfo):
if bootinfo.get("user") and bootinfo["user"].get("name"):
bootinfo["user"]["employee"] = ""
employee = frappe.db.get_value("Employee", {"user_id": bootinfo["user"]["name"]}, "name", cache=True)
if employee:
bootinfo["user"]["employee"] = employee