moved from MySQLdb to pymysql (#11462)
This commit is contained in:
parent
36e2fb8d58
commit
7fd20f303f
@ -1,5 +1,5 @@
|
|||||||
import frappe
|
import frappe
|
||||||
from MySQLdb import OperationalError
|
from pymysql import InternalError
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
frappe.reload_doctype("Journal Entry Account")
|
frappe.reload_doctype("Journal Entry Account")
|
||||||
@ -15,6 +15,6 @@ def execute():
|
|||||||
frappe.db.sql("""update `tabJournal Entry Account`
|
frappe.db.sql("""update `tabJournal Entry Account`
|
||||||
set reference_type=%s, reference_name={0} where ifnull({0}, '') != ''
|
set reference_type=%s, reference_name={0} where ifnull({0}, '') != ''
|
||||||
""".format(fieldname), doctype)
|
""".format(fieldname), doctype)
|
||||||
except OperationalError:
|
except InternalError:
|
||||||
# column not found
|
# column not found
|
||||||
pass
|
pass
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
from __future__ import print_function, unicode_literals
|
from __future__ import print_function, unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
import MySQLdb
|
from frappe.exceptions import SQLError
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
"""
|
"""
|
||||||
@ -31,7 +31,7 @@ def execute():
|
|||||||
try:
|
try:
|
||||||
migrate_item_variants()
|
migrate_item_variants()
|
||||||
|
|
||||||
except MySQLdb.ProgrammingError:
|
except SQLError:
|
||||||
print("`tabItem Variant` not found")
|
print("`tabItem Variant` not found")
|
||||||
|
|
||||||
def rename_and_reload_doctypes():
|
def rename_and_reload_doctypes():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user