commit | c103f72faddf9b7afd9d58d44703e98c6e687605 | [log] [tgz] |
---|---|---|
author | Saqib Ansari <nextchamp.saqib@gmail.com> | Tue Oct 12 13:13:48 2021 +0530 |
committer | Saqib Ansari <nextchamp.saqib@gmail.com> | Tue Oct 12 13:13:48 2021 +0530 |
tree | 998bbacfbaaaf8cefb705bc6aa6db904db1cbf78 | |
parent | 353ad5f6ffa7e4aaa472f3882d6ef19faa9d3431 [diff] |
fix: rollback on exception
diff --git a/erpnext/patches/v13_0/modify_invalid_gain_loss_gl_entries.py b/erpnext/patches/v13_0/modify_invalid_gain_loss_gl_entries.py index ddf70aa..3af7dac 100644 --- a/erpnext/patches/v13_0/modify_invalid_gain_loss_gl_entries.py +++ b/erpnext/patches/v13_0/modify_invalid_gain_loss_gl_entries.py
@@ -52,7 +52,9 @@ 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: