Skip to content

Commit

Permalink
fix: company doctype handle concurrent transaction error on get_timel…
Browse files Browse the repository at this point in the history
…ine_data
  • Loading branch information
tohidmalik002 committed Oct 10, 2024
1 parent 8b0cb73 commit d7e31de
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions erpnext/setup/doctype/company/company.py
Original file line number Diff line number Diff line change
Expand Up @@ -879,9 +879,9 @@ def get_timeline_data(doctype, name):
date_to_value_dict = None

if date_to_value_dict is None:
update_transactions_annual_history(name, True)
history = frappe.get_cached_value("Company", name, "transactions_annual_history")
return json.loads(history) if history and "{" in history else {}
frappe.enqueue(update_transactions_annual_history, company = name, commit = True)
history = get_all_transactions_annual_history(name)
return history if isinstance(history, dict) else {}

return date_to_value_dict

Expand Down

0 comments on commit d7e31de

Please sign in to comment.