fix: reposting failed status not updated (backport #39970) (#39972)

fix: reposting failed status not updated (#39970)

(cherry picked from commit d4264f7ba12322f05f7f8128fd5a1cd8bc6eb231)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
mergify[bot] 2024-02-20 12:35:46 +05:30 committed by GitHub
parent a102172982
commit 46f7569a54
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -299,9 +299,20 @@ def repost(doc):
doc.log_error("Unable to repost item valuation")
message = frappe.message_log.pop() if frappe.message_log else ""
if isinstance(message, dict):
message = message.get("message")
if traceback:
message += "<br>" + "Traceback: <br>" + traceback
frappe.db.set_value(doc.doctype, doc.name, "error_log", message)
message += "<br><br>" + "<b>Traceback:</b> <br>" + traceback
frappe.db.set_value(
doc.doctype,
doc.name,
{
"error_log": message,
"status": "Failed",
},
)
outgoing_email_account = frappe.get_cached_value(
"Email Account", {"default_outgoing": 1, "enable_outgoing": 1}, "name"