mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-10 22:06:52 +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
cb17dbd616
commit
773e56808a
@@ -300,7 +300,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})
|
||||
|
||||
@@ -453,6 +453,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