fix: QI reference not set if 'Action If Quality Inspection Is Not Sub… (backport #47294) (#47295)

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 0701a8cf5a)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
mergify[bot]
2025-04-28 22:01:57 +05:30
committed by GitHub
parent 91bcefef8c
commit b0399fe948

View File

@@ -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):