Skip to content

Commit

Permalink
feat: add employee number to client user bootinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
casesolved-co-uk committed Nov 30, 2023
1 parent ba10f7d commit b145786
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"):
bootinfo["user"]["employee"] = ""
employee = frappe.db.get_value("Employee", {"user_id": bootinfo["user"]["name"]}, "name")
if employee:
bootinfo["user"]["employee"] = employee

0 comments on commit b145786

Please sign in to comment.