mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-14 10:13:57 +00:00
fix: add validation to reject empty readings
(cherry picked from commit 405d901514)
This commit is contained in:
committed by
Mergify
parent
5bb2e8a8ff
commit
ac0375fc2e
@@ -283,9 +283,11 @@ class QualityInspection(Document):
|
||||
|
||||
def min_max_criteria_passed(self, reading):
|
||||
"""Determine whether all readings fall in the acceptable range."""
|
||||
has_reading = False
|
||||
for i in range(1, 11):
|
||||
reading_value = reading.get("reading_" + str(i))
|
||||
if reading_value is not None and reading_value.strip():
|
||||
has_reading = True
|
||||
result = (
|
||||
flt(reading.get("min_value"))
|
||||
<= parse_float(reading_value)
|
||||
@@ -293,7 +295,7 @@ class QualityInspection(Document):
|
||||
)
|
||||
if not result:
|
||||
return False
|
||||
return True
|
||||
return has_reading
|
||||
|
||||
def set_status_based_on_acceptance_formula(self, reading):
|
||||
if not reading.acceptance_formula:
|
||||
|
||||
Reference in New Issue
Block a user