[hotfix] [patch] cleanup journal entry

This commit is contained in:
Anand Doshi 2015-08-14 12:17:34 +05:30
parent dc278a7427
commit 487454e817

View File

@ -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