patch: Old Shift Assignment

This commit is contained in:
Anurag Mishra 2020-08-13 14:06:20 +05:30
parent c2710e05ce
commit f096ba4998
2 changed files with 11 additions and 0 deletions

View File

@ -721,3 +721,4 @@ erpnext.patches.v13_0.healthcare_lab_module_rename_doctypes
erpnext.patches.v13_0.stock_entry_enhancements
erpnext.patches.v12_0.update_state_code_for_daman_and_diu
erpnext.patches.v12_0.rename_lost_reason_detail
erpnext.patches.v13_0.update_start_end_date_for_old_shift_assignment

View File

@ -0,0 +1,10 @@
# Copyright (c) 2019, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
frappe.reload_doc('hr', 'doctype', 'shift_assignment')
frappe.db.sql("update `tabShift Assignment` set end_date=date, start_date=date, status='Inactive' where date IS NOT NULL and start_date IS NULL and end_date IS NULL;")