brotherton-erpnext/erpnext/patches/v13_0/requeue_failed_reposts.py
Noah Jacob 2bb383b178
fix: not authorized to update entries after freezing accounts (#27937)
* fix: not authorized to update entries after freezing accounts

* fix: Add test case

* fix(patch): patched to requeue failed reposts(check_freezing_date)

* chore: misc fixes

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
2021-10-13 16:20:08 +05:30

14 lines
368 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")