From b0399fe9488101b4787a4508e96b6269ff28933e Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 28 Apr 2025 22:01:57 +0530 Subject: [PATCH] =?UTF-8?q?fix:=20QI=20reference=20not=20set=20if=20'Actio?= =?UTF-8?q?n=20If=20Quality=20Inspection=20Is=20Not=20Sub=E2=80=A6=20(back?= =?UTF-8?q?port=20#47294)=20(#47295)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix: QI reference not set if 'Action If Quality Inspection Is Not Sub… (#47294) fix: qi reference not set if 'Action If Quality Inspection Is Not Submitted' is blank (cherry picked from commit 0701a8cf5a1a410f1ce587e06258bbe8d08fa9c8) Co-authored-by: rohitwaghchaure --- .../doctype/quality_inspection/quality_inspection.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/erpnext/stock/doctype/quality_inspection/quality_inspection.py b/erpnext/stock/doctype/quality_inspection/quality_inspection.py index 8aed2277de3..021b7b1cf17 100644 --- a/erpnext/stock/doctype/quality_inspection/quality_inspection.py +++ b/erpnext/stock/doctype/quality_inspection/quality_inspection.py @@ -203,10 +203,11 @@ class QualityInspection(Document): self.get_item_specification_details() def on_update(self): - if ( - frappe.db.get_single_value("Stock Settings", "action_if_quality_inspection_is_not_submitted") - == "Warn" - ): + action_if_qi_in_draft = frappe.db.get_single_value( + "Stock Settings", "action_if_quality_inspection_is_not_submitted" + ) + + if not action_if_qi_in_draft or action_if_qi_in_draft == "Warn": self.update_qc_reference() def on_submit(self):