mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-06 03:52:15 +00:00
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 3fd5a0f100)
This commit is contained in:
@@ -278,7 +278,9 @@ class QualityInspection(Document):
|
|||||||
|
|
||||||
def set_status_based_on_acceptance_values(self, reading):
|
def set_status_based_on_acceptance_values(self, reading):
|
||||||
if not cint(reading.numeric):
|
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:
|
else:
|
||||||
# numeric readings
|
# numeric readings
|
||||||
result = self.min_max_criteria_passed(reading)
|
result = self.min_max_criteria_passed(reading)
|
||||||
|
|||||||
Reference in New Issue
Block a user