mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-19 18:25:32 +00:00
Merge pull request #44402 from frappe/mergify/bp/version-15-hotfix/pr-44400
fix: IndexError in Asset Depreciation Ledger when query result is empty (backport #44400)
This commit is contained in:
@@ -89,7 +89,9 @@ def get_data(filters):
|
||||
& (DepreciationSchedule.schedule_date == d.posting_date)
|
||||
)
|
||||
).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:
|
||||
asset_data.accumulated_depreciation_amount += d.debit
|
||||
|
||||
Reference in New Issue
Block a user