Browse Source

fix: rollback on exception

develop
Saqib Ansari 3 years ago
parent
commit
c103f72fad
  1. 2
      erpnext/patches/v13_0/modify_invalid_gain_loss_gl_entries.py

2
erpnext/patches/v13_0/modify_invalid_gain_loss_gl_entries.py

@ -52,7 +52,9 @@ def execute():
advance.db_set('exchange_gain_loss', 0, False)
doc.docstatus = 1
doc.make_gl_entries()
frappe.db.commit()
except Exception:
frappe.db.rollback()
print(f'Failed to correct gl entries of {invoice.name}')
if acc_frozen_upto:

Loading…
Cancel
Save