fix: update patch

This commit is contained in:
prssanna 2021-04-16 13:03:21 +05:30
parent 3614ca2a4d
commit ba267b6e62
2 changed files with 2 additions and 4 deletions

View file

@ -337,4 +337,4 @@ frappe.patches.v12_0.rename_uploaded_files_with_proper_name
frappe.patches.v13_0.queryreport_columns
frappe.patches.v13_0.jinja_hook
frappe.patches.v13_0.update_notification_channel_if_empty
frappe.patches.v13_0.add_original_name_docfield_to_submittable_doctypes #######
frappe.patches.v13_0.add_original_name_docfield_to_submittable_doctypes

View file

@ -1,11 +1,9 @@
import frappe
from frappe.database.schema import add_column
def execute():
for doctype in frappe.db.get_all('DocType'):
doctype = frappe.get_doc("DocType", doctype.name)
if doctype.is_submittable and frappe.db.table_exists(doctype.name):
doctype.make_cancellable()
if not frappe.db.has_column(doctype.name, 'original_name'):
add_column(doctype.name, 'original_name', 'Text')
frappe.reload_doctype(doctype.name)
doctype.db_update_all()