mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-18 00:55:02 +00:00
refactor: dont ignore dangerous exceptions in patches
This commit is contained in:
@@ -4,20 +4,18 @@ import frappe
|
||||
|
||||
def execute():
|
||||
#handle type casting for is_cancelled field
|
||||
module_doctypes = (
|
||||
('stock', 'Stock Ledger Entry'),
|
||||
('stock', 'Serial No'),
|
||||
('accounts', 'GL Entry')
|
||||
)
|
||||
|
||||
for doc_mapper in (('stock','Stock Ledger Entry'),
|
||||
('stock','Serial No'),
|
||||
('accounts','GL Entry')):
|
||||
try:
|
||||
module = doc_mapper[0]
|
||||
doctype = doc_mapper[1]
|
||||
|
||||
for module, doctype in module_doctypes:
|
||||
if frappe.db.has_column(doctype, "is_cancelled"):
|
||||
frappe.db.sql('''UPDATE `tab{doctype}` SET is_cancelled = CASE
|
||||
WHEN is_cancelled = 'No' THEN 0
|
||||
WHEN is_cancelled = 'Yes' THEN 1
|
||||
ELSE 0
|
||||
END'''.format(doctype=doctype))
|
||||
|
||||
frappe.reload_doc(module, "doctype", frappe.scrub(doctype))
|
||||
except Exception:
|
||||
pass
|
||||
frappe.reload_doc(module, "doctype", frappe.scrub(doctype))
|
||||
|
||||
Reference in New Issue
Block a user