From 53cd60c217fc2442dc8d1db23c2595446efc08bb Mon Sep 17 00:00:00 2001 From: marination Date: Mon, 7 Sep 2020 20:45:50 +0530 Subject: [PATCH] fix: Patch reload doctype --- erpnext/patches/v13_0/set_youtube_video_id.py | 2 ++ erpnext/utilities/doctype/video/video.py | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/patches/v13_0/set_youtube_video_id.py b/erpnext/patches/v13_0/set_youtube_video_id.py index 8e5dd306a9..c3b49eb4fe 100644 --- a/erpnext/patches/v13_0/set_youtube_video_id.py +++ b/erpnext/patches/v13_0/set_youtube_video_id.py @@ -3,6 +3,8 @@ import frappe from erpnext.utilities.doctype.video.video import get_id_from_url def execute(): + frappe.reload_doc("utilities", "doctype","video") + for video in frappe.get_all("Video", fields=["name", "url", "youtube_video_id"]): if video.url and not video.youtube_video_id: frappe.db.set_value("Video", video.name, "youtube_video_id", get_id_from_url(video.url)) \ No newline at end of file diff --git a/erpnext/utilities/doctype/video/video.py b/erpnext/utilities/doctype/video/video.py index 3b6bd7e0df..6971beb5d7 100644 --- a/erpnext/utilities/doctype/video/video.py +++ b/erpnext/utilities/doctype/video/video.py @@ -140,8 +140,6 @@ def batch_update_youtube_data(): comment_count = %(comment_count)s WHERE youtube_video_id = '{0}'""".format(video_id), stats) - frappe.log_error("yooooooooo") - video_list = frappe.get_all("Video", fields=["youtube_video_id"]) if len(video_list) > 50: # Update in batches of 50