From 0d8b9a9d0a110d7379ebb9eba9e96d61bb1ca02b Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Thu, 20 May 2021 19:53:30 +0530 Subject: [PATCH] fix(patch): billable field not renamed --- erpnext/patches/v13_0/update_timesheet_changes.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/erpnext/patches/v13_0/update_timesheet_changes.py b/erpnext/patches/v13_0/update_timesheet_changes.py index 3acce18c63..93b7f8e59a 100644 --- a/erpnext/patches/v13_0/update_timesheet_changes.py +++ b/erpnext/patches/v13_0/update_timesheet_changes.py @@ -3,19 +3,20 @@ import frappe from frappe.model.utils.rename_field import rename_field def execute(): - if "billable" in frappe.db.get_table_columns("Timesheet Detail"): - rename_field("Timesheet Detail", "billable", "is_billable") - - base_currency = frappe.defaults.get_global_default('currency') frappe.reload_doc("projects", "doctype", "timesheet") frappe.reload_doc("projects", "doctype", "timesheet_detail") + if frappe.db.has_column("Timesheet Detail", "billable"): + rename_field("Timesheet Detail", "billable", "is_billable") + + base_currency = frappe.defaults.get_global_default('currency') + frappe.db.sql("""UPDATE `tabTimesheet Detail` SET base_billing_rate = billing_rate, base_billing_amount = billing_amount, base_costing_rate = costing_rate, base_costing_amount = costing_amount""") - + frappe.db.sql("""UPDATE `tabTimesheet` SET currency = '{0}', exchange_rate = 1.0,