Merge pull request #23781 from rohitwaghchaure/patch-to-update-reason-for-leaving

fix: patch to update reason for leaving in employee
This commit is contained in:
rohitwaghchaure 2020-10-30 16:47:48 +05:30 committed by GitHub
commit ce7f9dffa9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View File

@ -732,3 +732,4 @@ erpnext.patches.v13_0.set_youtube_video_id
erpnext.patches.v13_0.print_uom_after_quantity_patch
erpnext.patches.v13_0.set_payment_channel_in_payment_gateway_account
erpnext.patches.v13_0.create_healthcare_custom_fields_in_stock_entry_detail
erpnext.patches.v13_0.update_reason_for_resignation_in_employee

View File

@ -0,0 +1,15 @@
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
frappe.reload_doc("hr", "doctype", "employee")
if frappe.db.has_column("Employee", "reason_for_resignation"):
frappe.db.sql(""" UPDATE `tabEmployee`
SET reason_for_leaving = reason_for_resignation
WHERE status = 'Left' and reason_for_leaving is null and reason_for_resignation is not null
""")