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
…38603)

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 4b76cc4 commit c7dbcbc
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 @@ -637,6 +637,7 @@

extend_bootinfo = [
"erpnext.support.doctype.service_level_agreement.service_level_agreement.add_sla_doctypes",
"erpnext.startup.boot.bootinfo",
]


Expand Down
8 changes: 8 additions & 0 deletions erpnext/startup/boot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c7dbcbc

Please sign in to comment.