Skip to content

Commit

Permalink
Merge pull request #42145 from frappe/mergify/bp/version-15-hotfix/pr…
Browse files Browse the repository at this point in the history
…-42144

fix: handle none type object error (backport #42144)
  • Loading branch information
khushi8112 authored Jul 2, 2024
2 parents a45f8ca + b0aef9e commit 8b3ffc9
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ def execute():
depr_schedule = get_depr_schedule(asset.name, "Active", fb_row.finance_book)
total_number_of_booked_depreciations = asset.opening_number_of_booked_depreciations or 0

for je in depr_schedule:
if je.journal_entry:
total_number_of_booked_depreciations += 1
if depr_schedule:
for je in depr_schedule:
if je.journal_entry:
total_number_of_booked_depreciations += 1
frappe.db.set_value(
"Asset Finance Book",
fb_row.name,
Expand Down

0 comments on commit 8b3ffc9

Please sign in to comment.