Merge pull request #7808 from KanchanChauhan/attendance-rename-field

[Patch] Attendance Date field renamed
This commit is contained in:
Nabin Hait 2017-02-21 16:01:50 +05:30 committed by GitHub
commit 293158db6e
2 changed files with 15 additions and 0 deletions

View File

@ -374,3 +374,4 @@ erpnext.patches.v7_2.update_party_type
erpnext.patches.v7_2.setup_auto_close_settings
erpnext.patches.v7_2.empty_supplied_items_for_non_subcontracted
erpnext.patches.v7_2.arrear_leave_encashment_as_salary_component
erpnext.patches.v7_2.rename_att_date_attendance

View File

@ -0,0 +1,14 @@
import frappe
from frappe.model.utils.rename_field import update_reports, update_users_report_view_settings, update_property_setters
def execute():
if "att_date" not in frappe.db.get_table_columns("Attendance"):
return
frappe.reload_doc("hr", "doctype", "attendance")
frappe.db.sql("""update `tabAttendance`
set attendance_date = att_date
where attendance_date is null or attendance_date = '' or attendance_date = '0000-00-00'""")
update_reports("Attendance", "att_date", "attendance_date")
update_users_report_view_settings("Attendance", "att_date", "attendance_date")
update_property_setters("Attendance", "att_date", "attendance_date")