From c1d198d20521fb76236effa7c652661958da46bb Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Sun, 9 Aug 2026 15:45:07 +0530 Subject: [PATCH] fix: sync open reference forms after Quality Inspection updates them update_qc_reference() writes the QI link and bumps the reference document's modified timestamp via raw db writes, which emit no realtime event. A reference form (Purchase Receipt, Delivery Note, Stock Entry, Job Card) still open in the browser keeps the old timestamp and fails the timestamp conflict check on the next save/submit, forcing a manual refresh after every QI submit/cancel/delete. Calling notify_update() on the reference publishes the standard doc_update event, so an open, unedited form silently reloads and syncs its timestamp. get_lazy_doc skips child table loading since notify_update only needs the parent row. (cherry picked from commit 647452c95befc0cb6b749478372b95899e059a1d) --- erpnext/stock/doctype/quality_inspection/quality_inspection.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/stock/doctype/quality_inspection/quality_inspection.py b/erpnext/stock/doctype/quality_inspection/quality_inspection.py index a7733b0bf8b..1fbf323f0dd 100644 --- a/erpnext/stock/doctype/quality_inspection/quality_inspection.py +++ b/erpnext/stock/doctype/quality_inspection/quality_inspection.py @@ -253,6 +253,9 @@ class QualityInspection(Document): self.modified, ) + if self.reference_type and self.reference_name: + frappe.get_lazy_doc(self.reference_type, self.reference_name).notify_update() + def inspect_and_set_status(self): for reading in self.readings: if not reading.manual_inspection: # dont auto set status if manual