From d4264f7ba12322f05f7f8128fd5a1cd8bc6eb231 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Tue, 20 Feb 2024 12:13:18 +0530 Subject: [PATCH] fix: reposting failed status not updated (#39970) --- .../repost_item_valuation.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py b/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py index 31fc2cab6a5f..a383798af57e 100644 --- a/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py +++ b/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py @@ -294,9 +294,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 += "
" + "Traceback:
" + traceback - frappe.db.set_value(doc.doctype, doc.name, "error_log", message) + message += "

" + "Traceback:
" + 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"