mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-27 00:44:45 +00:00
Merge pull request #44400 from khushi8112/asset-depreciation-error-index-error
fix: IndexError in Asset Depreciation Ledger when query result is empty
This commit is contained in:
@@ -89,7 +89,9 @@ def get_data(filters):
|
|||||||
& (DepreciationSchedule.schedule_date == d.posting_date)
|
& (DepreciationSchedule.schedule_date == d.posting_date)
|
||||||
)
|
)
|
||||||
).run(as_dict=True)
|
).run(as_dict=True)
|
||||||
asset_data.accumulated_depreciation_amount = query[0]["accumulated_depreciation_amount"]
|
asset_data.accumulated_depreciation_amount = (
|
||||||
|
query[0]["accumulated_depreciation_amount"] if query else 0
|
||||||
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
asset_data.accumulated_depreciation_amount += d.debit
|
asset_data.accumulated_depreciation_amount += d.debit
|
||||||
|
|||||||
Reference in New Issue
Block a user