mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-27 22:05:19 +00:00
refactor: use common method to get employee contacts
This commit is contained in:
@@ -6,7 +6,6 @@ from frappe.model.naming import set_name_by_naming_series
|
||||
from frappe.permissions import (
|
||||
add_user_permission,
|
||||
get_doc_permissions,
|
||||
has_permission,
|
||||
remove_user_permission,
|
||||
)
|
||||
from frappe.utils import cstr, getdate, today, validate_email_address
|
||||
@@ -431,6 +430,12 @@ def has_upload_permission(doc, ptype="read", user=None):
|
||||
def get_contact_details(employee: str) -> dict:
|
||||
"""
|
||||
Returns basic contact details for the given employee.
|
||||
|
||||
Email is selected based on the following priority:
|
||||
1. Prefered Email
|
||||
2. Company Email
|
||||
3. Personal Email
|
||||
4. User ID
|
||||
"""
|
||||
if not employee:
|
||||
frappe.throw(msg=_("Employee is required"), title=_("Missing Parameter"))
|
||||
|
||||
Reference in New Issue
Block a user