feat: add employee number to client user bootinfo (#38477)
(cherry picked from commit 525f656cc1)
Co-authored-by: Richard Case <110036763+casesolved-co-uk@users.noreply.github.com>
This commit is contained in:
@@ -638,4 +638,5 @@ additional_timeline_content = {
|
||||
|
||||
extend_bootinfo = [
|
||||
"erpnext.support.doctype.service_level_agreement.service_level_agreement.add_sla_doctypes",
|
||||
"erpnext.startup.boot.bootinfo",
|
||||
]
|
||||
|
||||
@@ -73,3 +73,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
|
||||
|
||||
Reference in New Issue
Block a user