Merge pull request #43733 from frappe/mergify/bp/version-15-hotfix/pr-43723

fix: do not make new depreciation for fully depreciated asset (backport #43723)
This commit is contained in:
Khushi Rawat
2024-10-21 02:13:44 +05:30
committed by GitHub

View File

@@ -1359,14 +1359,15 @@ class SalesInvoice(SellingController):
else: else:
if asset.calculate_depreciation: if asset.calculate_depreciation:
notes = _( if not asset.status == "Fully Depreciated":
"This schedule was created when Asset {0} was sold through Sales Invoice {1}." notes = _(
).format( "This schedule was created when Asset {0} was sold through Sales Invoice {1}."
get_link_to_form(asset.doctype, asset.name), ).format(
get_link_to_form(self.doctype, self.get("name")), get_link_to_form(asset.doctype, asset.name),
) get_link_to_form(self.doctype, self.get("name")),
depreciate_asset(asset, self.posting_date, notes) )
asset.reload() depreciate_asset(asset, self.posting_date, notes)
asset.reload()
fixed_asset_gl_entries = get_gl_entries_on_asset_disposal( fixed_asset_gl_entries = get_gl_entries_on_asset_disposal(
asset, asset,