mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-12 06:48:31 +00:00
refactor: method to get employee contact without permission check
(cherry picked from commit 58cdb9503b)
This commit is contained in:
committed by
Mergify
parent
63975c8c00
commit
5c9f9517d6
@@ -296,7 +296,7 @@ def complete_contact_details(party_details):
|
||||
contact_details = frappe._dict()
|
||||
|
||||
if party_details.party_type == "Employee":
|
||||
from erpnext.setup.doctype.employee.employee import get_contact_details as get_employee_contact
|
||||
from erpnext.setup.doctype.employee.employee import _get_contact_details as get_employee_contact
|
||||
|
||||
contact_details = get_employee_contact(party_details.party)
|
||||
contact_details.update({"contact_person": None, "contact_phone": None})
|
||||
|
||||
@@ -446,6 +446,10 @@ def get_contact_details(employee: str) -> dict:
|
||||
|
||||
frappe.has_permission("Employee", "read", employee, throw=True)
|
||||
|
||||
return _get_contact_details(employee)
|
||||
|
||||
|
||||
def _get_contact_details(employee: str) -> dict:
|
||||
contact_data = frappe.db.get_value(
|
||||
"Employee",
|
||||
employee,
|
||||
|
||||
Reference in New Issue
Block a user