2019-01-22 12:52:20 +00:00
|
|
|
from __future__ import unicode_literals
|
2017-01-22 05:31:02 +00:00
|
|
|
import frappe
|
|
|
|
|
|
|
|
def execute():
|
2020-06-19 13:47:57 +00:00
|
|
|
frappe.reload_doc('Payroll', 'doctype', 'Salary Slip')
|
2017-01-22 05:31:02 +00:00
|
|
|
if not frappe.db.has_column('Salary Detail', 'abbr'):
|
|
|
|
return
|
|
|
|
|
|
|
|
salary_details = frappe.db.sql("""select abbr, salary_component, name from `tabSalary Detail`
|
|
|
|
where abbr is null or abbr = ''""", as_dict=True)
|
|
|
|
|
|
|
|
for salary_detail in salary_details:
|
|
|
|
salary_component_abbr = frappe.get_value("Salary Component", salary_detail.salary_component, "salary_component_abbr")
|
|
|
|
frappe.db.sql("""update `tabSalary Detail` set abbr = %s where name = %s""",(salary_component_abbr, salary_detail.name))
|