mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 18:59:08 +00:00
[Fix] Salary structure not saving (#16275)
This commit is contained in:
committed by
Rushabh Mehta
parent
5a9579bae4
commit
deb96dab3e
@@ -4,7 +4,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
|
|
||||||
from frappe.utils import flt, cint
|
from frappe.utils import flt, cint, cstr
|
||||||
from frappe import _
|
from frappe import _
|
||||||
from frappe.model.mapper import get_mapped_doc
|
from frappe.model.mapper import get_mapped_doc
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
@@ -22,7 +22,7 @@ class SalaryStructure(Document):
|
|||||||
overwritten_fields_if_missing = ["amount_based_on_formula", "formula", "amount"]
|
overwritten_fields_if_missing = ["amount_based_on_formula", "formula", "amount"]
|
||||||
for table in ["earnings", "deductions"]:
|
for table in ["earnings", "deductions"]:
|
||||||
for d in self.get(table):
|
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)
|
overwritten_fields + overwritten_fields_if_missing, as_dict=1)
|
||||||
if component_default_value:
|
if component_default_value:
|
||||||
for fieldname in overwritten_fields:
|
for fieldname in overwritten_fields:
|
||||||
|
|||||||
Reference in New Issue
Block a user