Skip to content

Commit

Permalink
fix: make readings status mandatory in Quality Inspection
Browse files Browse the repository at this point in the history
(cherry picked from commit d7c3b76)
  • Loading branch information
s-aga-r authored and mergify[bot] committed Oct 10, 2022
1 parent e6abbd1 commit 257a2a3
Showing 1 changed file with 8 additions and 0 deletions.
Expand Up @@ -30,6 +30,9 @@ def validate(self):
if self.readings:
self.inspect_and_set_status()

def before_submit(self):
self.validate_readings_status_mandatory()

@frappe.whitelist()
def get_item_specification_details(self):
if not self.quality_inspection_template:
Expand Down Expand Up @@ -65,6 +68,11 @@ def on_submit(self):
def on_cancel(self):
self.update_qc_reference()

def validate_readings_status_mandatory(self):
for reading in self.readings:
if not reading.status:
frappe.throw(_("Row #{0}: Status is mandatory").format(reading.idx))

def update_qc_reference(self):
quality_inspection = self.name if self.docstatus == 1 else ""

Expand Down

0 comments on commit 257a2a3

Please sign in to comment.