From c5164d0150cc5d6bfe189adfd33725334f24244d Mon Sep 17 00:00:00 2001 From: Kaushal Shriwas Date: Tue, 24 Mar 2026 20:31:53 +0530 Subject: [PATCH] fix: reload Prepared Report before save to avoid TimestampMismatchError --- frappe/core/doctype/prepared_report/prepared_report.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frappe/core/doctype/prepared_report/prepared_report.py b/frappe/core/doctype/prepared_report/prepared_report.py index 20dcca24ed..3aa9e4f0d5 100644 --- a/frappe/core/doctype/prepared_report/prepared_report.py +++ b/frappe/core/doctype/prepared_report/prepared_report.py @@ -141,7 +141,10 @@ def generate_report(prepared_report): except Exception: # we need to ensure that error gets stored _save_error(instance, error=frappe.get_traceback(with_context=True)) + return + instance.reload() + instance.status = "Completed" instance.report_end_time = frappe.utils.now() instance.peak_memory_usage = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss add_data_to_monitor(peak_memory_usage=instance.peak_memory_usage)