mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-23 15:09:20 +00:00
fix: Patch reload doctype
This commit is contained in:
@@ -3,6 +3,8 @@ import frappe
|
|||||||
from erpnext.utilities.doctype.video.video import get_id_from_url
|
from erpnext.utilities.doctype.video.video import get_id_from_url
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
|
frappe.reload_doc("utilities", "doctype","video")
|
||||||
|
|
||||||
for video in frappe.get_all("Video", fields=["name", "url", "youtube_video_id"]):
|
for video in frappe.get_all("Video", fields=["name", "url", "youtube_video_id"]):
|
||||||
if video.url and not video.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))
|
frappe.db.set_value("Video", video.name, "youtube_video_id", get_id_from_url(video.url))
|
||||||
@@ -140,8 +140,6 @@ def batch_update_youtube_data():
|
|||||||
comment_count = %(comment_count)s
|
comment_count = %(comment_count)s
|
||||||
WHERE youtube_video_id = '{0}'""".format(video_id), stats)
|
WHERE youtube_video_id = '{0}'""".format(video_id), stats)
|
||||||
|
|
||||||
frappe.log_error("yooooooooo")
|
|
||||||
|
|
||||||
video_list = frappe.get_all("Video", fields=["youtube_video_id"])
|
video_list = frappe.get_all("Video", fields=["youtube_video_id"])
|
||||||
if len(video_list) > 50:
|
if len(video_list) > 50:
|
||||||
# Update in batches of 50
|
# Update in batches of 50
|
||||||
|
|||||||
Reference in New Issue
Block a user