mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 07:54:46 +00:00
Merge pull request #45895 from khushi8112/fix-scrapping-of-fully-depreciated-asset
fix: do not reschedule depreciation for fully depreciated asset on scrap
This commit is contained in:
@@ -448,9 +448,9 @@ def scrap_asset(asset_name, scrap_date=None):
|
|||||||
notes = _("This schedule was created when Asset {0} was scrapped.").format(
|
notes = _("This schedule was created when Asset {0} was scrapped.").format(
|
||||||
get_link_to_form(asset.doctype, asset.name)
|
get_link_to_form(asset.doctype, asset.name)
|
||||||
)
|
)
|
||||||
|
if asset.status != "Fully Depreciated":
|
||||||
depreciate_asset(asset, date, notes)
|
depreciate_asset(asset, date, notes)
|
||||||
asset.reload()
|
asset.reload()
|
||||||
|
|
||||||
depreciation_series = frappe.get_cached_value("Company", asset.company, "series_for_depreciation_entry")
|
depreciation_series = frappe.get_cached_value("Company", asset.company, "series_for_depreciation_entry")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user