Skip to content

Commit

Permalink
fix: set Quality Inspection status based on readings status
Browse files Browse the repository at this point in the history
(cherry picked from commit 2657ece)
  • Loading branch information
s-aga-r authored and mergify[bot] committed Oct 10, 2022
1 parent 257a2a3 commit d67b44f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions erpnext/stock/doctype/quality_inspection/quality_inspection.py
Expand Up @@ -132,6 +132,16 @@ def inspect_and_set_status(self):
# if not formula based check acceptance values set
self.set_status_based_on_acceptance_values(reading)

if not self.manual_inspection:
self.status = "Accepted"
for reading in self.readings:
if reading.status == "Rejected":
self.status = "Rejected"
frappe.msgprint(
_("Status set to rejected as there are one or more rejected readings."), alert=True
)
break

def set_status_based_on_acceptance_values(self, reading):
if not cint(reading.numeric):
result = reading.get("reading_value") == reading.get("value")
Expand Down

0 comments on commit d67b44f

Please sign in to comment.