From a358f777746c8acf83b40e6a53d1c3144ab7ae0f Mon Sep 17 00:00:00 2001 From: anandbaburajan Date: Thu, 15 Dec 2022 14:50:53 +0530 Subject: [PATCH] chore: move patch to post_model_sync and cancel asset depr schedule properly --- .../asset_depreciation_schedule.py | 1 + erpnext/patches.txt | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/assets/doctype/asset_depreciation_schedule/asset_depreciation_schedule.py b/erpnext/assets/doctype/asset_depreciation_schedule/asset_depreciation_schedule.py index 5639d3db97a..05784e77e7e 100644 --- a/erpnext/assets/doctype/asset_depreciation_schedule/asset_depreciation_schedule.py +++ b/erpnext/assets/doctype/asset_depreciation_schedule/asset_depreciation_schedule.py @@ -170,6 +170,7 @@ def cancel_asset_depr_schedules(asset_doc): frappe.db.set_value( "Asset Depreciation Schedule", asset_depr_schedule_doc.name, "status", "Cancelled" ) + asset_depr_schedule_doc.reload() asset_depr_schedule_doc.cancel() diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 622fda42d80..59d76b115c2 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -268,7 +268,6 @@ erpnext.patches.v13_0.show_hr_payroll_deprecation_warning erpnext.patches.v13_0.reset_corrupt_defaults erpnext.patches.v13_0.create_accounting_dimensions_for_asset_repair erpnext.patches.v15_0.delete_taxjar_doctypes -erpnext.patches.v15_0.create_asset_depreciation_schedules_from_assets [post_model_sync] execute:frappe.delete_doc_if_exists('Workspace', 'ERPNext Integrations Settings') @@ -319,4 +318,5 @@ erpnext.patches.v13_0.update_schedule_type_in_loans erpnext.patches.v14_0.create_accounting_dimensions_for_asset_capitalization erpnext.patches.v14_0.update_partial_tds_fields erpnext.patches.v14_0.create_incoterms_and_migrate_shipment -erpnext.patches.v14_0.setup_clear_repost_logs \ No newline at end of file +erpnext.patches.v14_0.setup_clear_repost_logs +erpnext.patches.v15_0.create_asset_depreciation_schedules_from_assets \ No newline at end of file