Patch to update Salary Detail where Salary Component Abbr is null
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index e600a57..b997dfc 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -362,4 +362,5 @@
erpnext.patches.v7_2.update_website_for_variant
erpnext.patches.v7_2.update_doctype_status
erpnext.patches.v7_2.update_salary_slips
-erpnext.patches.v7_2.set_null_value_to_fields
\ No newline at end of file
+erpnext.patches.v7_2.set_null_value_to_fields
+erpnext.patches.v7_2.update_abbr_in_salary_slips
\ No newline at end of file
diff --git a/erpnext/patches/v7_2/update_abbr_in_salary_slips.py b/erpnext/patches/v7_2/update_abbr_in_salary_slips.py
new file mode 100644
index 0000000..aa6965f
--- /dev/null
+++ b/erpnext/patches/v7_2/update_abbr_in_salary_slips.py
@@ -0,0 +1,13 @@
+import frappe
+
+def execute():
+ frappe.reload_doctype('Salary Slip')
+ 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))
\ No newline at end of file