Merge pull request #36259 from rohitwaghchaure/fixed-report-default-email-outgoing-error

fix: no default email account causing reposting issue
This commit is contained in:
rohitwaghchaure 2023-07-24 15:03:09 +05:30 committed by GitHub
commit 7f4dda1b06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -271,7 +271,11 @@ def repost(doc):
message += "<br>" + "Traceback: <br>" + traceback
frappe.db.set_value(doc.doctype, doc.name, "error_log", message)
if not isinstance(e, RecoverableErrors):
outgoing_email_account = frappe.get_cached_value(
"Email Account", {"default_outgoing": 1, "enable_outgoing": 1}, "name"
)
if outgoing_email_account and not isinstance(e, RecoverableErrors):
notify_error_to_stock_managers(doc, message)
doc.set_status("Failed")
finally: