From f096ba4998b056fe89d72250a748785bdf48a78c Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Thu, 13 Aug 2020 14:06:20 +0530 Subject: [PATCH] patch: Old Shift Assignment --- erpnext/patches.txt | 1 + .../update_start_end_date_for_old_shift_assignment.py | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 erpnext/patches/v13_0/update_start_end_date_for_old_shift_assignment.py diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 361fe8352ab..e17e949b3bc 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -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 diff --git a/erpnext/patches/v13_0/update_start_end_date_for_old_shift_assignment.py b/erpnext/patches/v13_0/update_start_end_date_for_old_shift_assignment.py new file mode 100644 index 00000000000..e9dafd41625 --- /dev/null +++ b/erpnext/patches/v13_0/update_start_end_date_for_old_shift_assignment.py @@ -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;") \ No newline at end of file