brotherton-erpnext/erpnext/patches/v13_0/requeue_failed_reposts.py
2022-03-28 18:52:46 +05:30

16 lines
373 B
Python

import frappe
from frappe.utils import cstr
def execute():
reposts = frappe.get_all(
"Repost Item Valuation",
{"status": "Failed", "modified": [">", "2021-10-05"]},
["name", "modified", "error_log"],
)
for repost in reposts:
if "check_freezing_date" in cstr(repost.error_log):
frappe.db.set_value("Repost Item Valuation", repost.name, "status", "Queued")