fix: do not reschedule depreciation for fully depreciated asset on scrap

(cherry picked from commit fd4c4f98fa)
This commit is contained in:
Khushi Rawat
2025-02-13 14:21:29 +05:30
committed by Mergify
parent 617a24d61e
commit 1e7c5ec0cb

View File

@@ -444,9 +444,9 @@ def scrap_asset(asset_name):
notes = _("This schedule was created when Asset {0} was scrapped.").format(
get_link_to_form(asset.doctype, asset.name)
)
depreciate_asset(asset, date, notes)
asset.reload()
if asset.status != "Fully Depreciated":
depreciate_asset(asset, date, notes)
asset.reload()
depreciation_series = frappe.get_cached_value("Company", asset.company, "series_for_depreciation_entry")