Hello, I’ve researched this but couldn’t figure out a solution.
I am planning to customize docs Quotation, Sales Order to have fields that fetch the logged in user details and show them in print as:
Sales Person: Full Name of user that created the quotation
Contact Details: User contact details
These fields should be automatically fetched from the employee user details.
I figured out I need to use “link” fields but how do I actually get the info.
This is important for us to have our employees details on all quotations and sales orders.
To get employee, add a similar field for Employee link, and employee name et al.
To fetch employee based on user logged in. Your employee and user need to be linked, via ERPNext User field on the employee.
Then you can use a custom script to fetch employee using the logged in user/creator of the document.
Be careful with Employee on sales records, as employee field leads to user permissions being applied. I.e. Normally an employee is supposed to only see their data, by having an employee field in say, sales documents, then this data can only be seen by the same employee, or any user(hr manager) who can view all employee records.