From 5c9a2b39bc7af52545b2d464a714c15a936d9e8c Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 22 Aug 2016 14:36:33 +0530 Subject: [PATCH] Revert "Ignore validating mandatory fields on converting timelogs to timesheets" --- erpnext/patches/v7_0/convert_timelog_to_timesheet.py | 10 +--------- erpnext/patches/v7_0/migrate_schools_to_erpnext.py | 5 ++--- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/erpnext/patches/v7_0/convert_timelog_to_timesheet.py b/erpnext/patches/v7_0/convert_timelog_to_timesheet.py index d00980f6cf..b802656f7f 100644 --- a/erpnext/patches/v7_0/convert_timelog_to_timesheet.py +++ b/erpnext/patches/v7_0/convert_timelog_to_timesheet.py @@ -16,6 +16,7 @@ def execute(): time_sheet = make_timesheet(data.production_order) args = get_timelog_data(data) add_timesheet_detail(time_sheet, args) + time_sheet.docstatus = data.docstatus time_sheet.note = data.note time_sheet.company = company @@ -24,15 +25,6 @@ def execute(): time_sheet.calculate_total_amounts() time_sheet.flags.ignore_validate = True time_sheet.save(ignore_permissions=True) - - # To ignore validate_mandatory_fields function - if data.docstatus == 1: - time_sheet.db_set("docstatus", 1) - for d in time_sheet.get("time_logs"): - d.db_set("docstatus", 1) - time_sheet.update_production_order(time_sheet.name) - time_sheet.update_task_and_project() - def get_timelog_data(data): return { diff --git a/erpnext/patches/v7_0/migrate_schools_to_erpnext.py b/erpnext/patches/v7_0/migrate_schools_to_erpnext.py index 2aa6f04376..f64f400feb 100644 --- a/erpnext/patches/v7_0/migrate_schools_to_erpnext.py +++ b/erpnext/patches/v7_0/migrate_schools_to_erpnext.py @@ -9,13 +9,12 @@ def execute(): frappe.reload_doc('website', 'doctype', 'portal_menu_item') frappe.reload_doc('buying', 'doctype', 'request_for_quotation') - if frappe.db.exists("Module Def", "Academics") \ - and frappe.db.get_value("Module Def", "Academics", "app_name") == "schools": + if 'schools' in frappe.get_installed_apps(): frappe.db.sql("""delete from `tabDesktop Icon`""") if not frappe.db.exists('Module Def', 'Schools') and frappe.db.exists('Module Def', 'Academics'): frappe.rename_doc("Module Def", "Academics", "Schools") - + remove_from_installed_apps("schools") def reload_doctypes_for_schools_icons():