From deb96dab3e89683d1460aa08799b3291705571fe Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Tue, 25 Dec 2018 13:58:20 +0530 Subject: [PATCH] [Fix] Salary structure not saving (#16275) --- erpnext/hr/doctype/salary_structure/salary_structure.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.py b/erpnext/hr/doctype/salary_structure/salary_structure.py index 7ead14030f2..202ae9bcfe5 100644 --- a/erpnext/hr/doctype/salary_structure/salary_structure.py +++ b/erpnext/hr/doctype/salary_structure/salary_structure.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import frappe -from frappe.utils import flt, cint +from frappe.utils import flt, cint, cstr from frappe import _ from frappe.model.mapper import get_mapped_doc from frappe.model.document import Document @@ -22,7 +22,7 @@ class SalaryStructure(Document): overwritten_fields_if_missing = ["amount_based_on_formula", "formula", "amount"] for table in ["earnings", "deductions"]: for d in self.get(table): - component_default_value = frappe.db.get_value("Salary Component", str(d.salary_component), + component_default_value = frappe.db.get_value("Salary Component", cstr(d.salary_component), overwritten_fields + overwritten_fields_if_missing, as_dict=1) if component_default_value: for fieldname in overwritten_fields: