Skip to content

Commit

Permalink
feat: add employee number to client user bootinfo (backport #38477) (#…
Browse files Browse the repository at this point in the history
…38602)

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

(cherry picked from commit 525f656)

Co-authored-by: Richard Case <110036763+casesolved-co-uk@users.noreply.github.com>
  • Loading branch information
mergify[bot] and casesolved-co-uk authored Dec 6, 2023
1 parent f6fcb7e commit c2a137f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions erpnext/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,4 +638,5 @@

extend_bootinfo = [
"erpnext.support.doctype.service_level_agreement.service_level_agreement.add_sla_doctypes",
"erpnext.startup.boot.bootinfo",
]
8 changes: 8 additions & 0 deletions erpnext/startup/boot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c2a137f

Please sign in to comment.