Skip to content

Commit

Permalink
Merge pull request #42144 from khushi8112/site-migration-issue
Browse files Browse the repository at this point in the history
fix: handle none type object error
  • Loading branch information
khushi8112 authored Jul 2, 2024
2 parents 99f2735 + 6760c9c commit bd98f2f
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 bd98f2f

Please sign in to comment.