From 487454e817a405f8c785800a3d69e29d4c8d61d9 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 14 Aug 2015 12:17:34 +0530 Subject: [PATCH] [hotfix] [patch] cleanup journal entry --- erpnext/patches/v5_4/cleanup_journal_entry.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/erpnext/patches/v5_4/cleanup_journal_entry.py b/erpnext/patches/v5_4/cleanup_journal_entry.py index 1d3f505ad4..a0c332324d 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