mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-04 14:08:29 +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.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user