From 842ad55235ec8ec41920339a89da82c4fc94808e Mon Sep 17 00:00:00 2001 From: Kanchan Chauhan Date: Tue, 7 Feb 2017 12:07:55 +0530 Subject: [PATCH] [Fix] Employee Details in Salary Slip preview --- erpnext/hr/doctype/salary_structure/salary_structure.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.py b/erpnext/hr/doctype/salary_structure/salary_structure.py index 0e2dd1bb4a..d60cd35bda 100644 --- a/erpnext/hr/doctype/salary_structure/salary_structure.py +++ b/erpnext/hr/doctype/salary_structure/salary_structure.py @@ -33,8 +33,13 @@ class SalaryStructure(Document): def make_salary_slip(source_name, target_doc = None, employee = None, as_print = False, print_format = None): def postprocess(source, target): if employee: + employee_details = frappe.db.get_value("Employee", employee, + ["employee_name", "branch", "designation", "department"], as_dict=1) target.employee = employee - target.employee_name = frappe.get_value("Employee",employee, "employee_name") + target.employee_name = employee_details.employee_name + target.branch = employee_details.branch + target.designation = employee_details.designation + target.department = employee_details.department target.run_method('process_salary_structure') doc = get_mapped_doc("Salary Structure", source_name, {