From 66d1b7c837977a64898edc34909fb1ff998723a9 Mon Sep 17 00:00:00 2001 From: Markus Lobedann Date: Tue, 17 Feb 2026 12:46:30 +0100 Subject: [PATCH] fix: bug with comparison regarding `None` values and empty string In their default state, the fields can be `None`. When a user enters something and deletes it afterwards, the fields contain an empty string. This fixes the comparison. (cherry picked from commit 3fd5a0f1005f30219787f862786c31954935ac21) --- .../stock/doctype/quality_inspection/quality_inspection.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/quality_inspection/quality_inspection.py b/erpnext/stock/doctype/quality_inspection/quality_inspection.py index f461fd54869..67fc49acb8a 100644 --- a/erpnext/stock/doctype/quality_inspection/quality_inspection.py +++ b/erpnext/stock/doctype/quality_inspection/quality_inspection.py @@ -278,7 +278,9 @@ class QualityInspection(Document): def set_status_based_on_acceptance_values(self, reading): if not cint(reading.numeric): - result = reading.get("reading_value") == reading.get("value") + reading_value = reading.get("reading_value") or "" + value = reading.get("value") or "" + result = reading_value == value else: # numeric readings result = self.min_max_criteria_passed(reading)