Skip to content

Commit

Permalink
fix: Test case
Browse files Browse the repository at this point in the history
(cherry picked from commit 23863c7)
  • Loading branch information
deepeshgarg007 authored and mergify-bot committed Sep 30, 2021
1 parent 774cd68 commit f1a669c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions erpnext/accounts/deferred_revenue.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,12 +374,15 @@ def make_gl_entries(doc, credit_account, debit_account, against,
try:
make_gl_entries(gl_entries, cancel=(doc.docstatus == 2), merge_entries=True)
frappe.db.commit()
except Exception:
frappe.db.rollback()
traceback = frappe.get_traceback()
frappe.log_error(message=traceback)

frappe.flags.deferred_accounting_error = True
except Exception as e:
if frappe.flags.in_test:
raise e
else:
frappe.db.rollback()
traceback = frappe.get_traceback()
frappe.log_error(message=traceback)

frappe.flags.deferred_accounting_error = True

def send_mail(deferred_process):
title = _("Error while processing deferred accounting for {0}").format(deferred_process)
Expand Down

0 comments on commit f1a669c

Please sign in to comment.