fix: do not recalculate depreciation on sale invoice cancellation for fully depreciated asset

This commit is contained in:
khushi8112
2025-07-30 13:50:32 +05:30
parent 609191c3a5
commit db41b14317

View File

@@ -1370,8 +1370,9 @@ class SalesInvoice(SellingController):
)
asset.db_set("disposal_date", None)
add_asset_activity(asset.name, _("Asset returned"))
asset_status = asset.get_status()
if asset.calculate_depreciation:
if asset.calculate_depreciation and not asset_status == "Fully Depreciated":
posting_date = (
frappe.db.get_value("Sales Invoice", self.return_against, "posting_date")
if self.is_return