diff --git a/erpnext/patches/v5_4/cleanup_journal_entry.py b/erpnext/patches/v5_4/cleanup_journal_entry.py index 1d3f505ad48..a0c332324d2 100644 --- a/erpnext/patches/v5_4/cleanup_journal_entry.py +++ b/erpnext/patches/v5_4/cleanup_journal_entry.py @@ -1,4 +1,5 @@ import frappe +from MySQLdb import OperationalError def execute(): frappe.reload_doctype("Journal Entry Account") @@ -10,6 +11,10 @@ def execute(): ("Journal Entry", "against_jv"), ("Expense Claim", "against_expense_claim"), ): - frappe.db.sql("""update `tabJournal Entry Account` - set reference_type=%s, reference_name={0} where ifnull({0}, '') != '' - """.format(fieldname), doctype) + try: + frappe.db.sql("""update `tabJournal Entry Account` + set reference_type=%s, reference_name={0} where ifnull({0}, '') != '' + """.format(fieldname), doctype) + except OperationalError: + # column not found + pass