mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-21 07:38:29 +00:00
fix: allow user to make QI after submission not working
(cherry picked from commit 9f62ec5192)
This commit is contained in:
@@ -1439,6 +1439,16 @@ class StockController(AccountsController):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
if qi_required: # validate row only if inspection is required on item level
|
if qi_required: # validate row only if inspection is required on item level
|
||||||
|
if self.doctype in [
|
||||||
|
"Purchase Receipt",
|
||||||
|
"Purchase Invoice",
|
||||||
|
"Sales Invoice",
|
||||||
|
"Delivery Note",
|
||||||
|
] and frappe.get_single_value(
|
||||||
|
"Stock Settings", "allow_to_make_quality_inspection_after_purchase_or_delivery"
|
||||||
|
):
|
||||||
|
return
|
||||||
|
|
||||||
self.validate_qi_presence(row)
|
self.validate_qi_presence(row)
|
||||||
if self.docstatus == 1:
|
if self.docstatus == 1:
|
||||||
self.validate_qi_submission(row)
|
self.validate_qi_submission(row)
|
||||||
@@ -1446,16 +1456,6 @@ class StockController(AccountsController):
|
|||||||
|
|
||||||
def validate_qi_presence(self, row):
|
def validate_qi_presence(self, row):
|
||||||
"""Check if QI is present on row level. Warn on save and stop on submit if missing."""
|
"""Check if QI is present on row level. Warn on save and stop on submit if missing."""
|
||||||
if self.doctype in [
|
|
||||||
"Purchase Receipt",
|
|
||||||
"Purchase Invoice",
|
|
||||||
"Sales Invoice",
|
|
||||||
"Delivery Note",
|
|
||||||
] and frappe.get_single_value(
|
|
||||||
"Stock Settings", "allow_to_make_quality_inspection_after_purchase_or_delivery"
|
|
||||||
):
|
|
||||||
return
|
|
||||||
|
|
||||||
if not row.quality_inspection:
|
if not row.quality_inspection:
|
||||||
msg = _("Row #{0}: Quality Inspection is required for Item {1}").format(
|
msg = _("Row #{0}: Quality Inspection is required for Item {1}").format(
|
||||||
row.idx, frappe.bold(row.item_code)
|
row.idx, frappe.bold(row.item_code)
|
||||||
|
|||||||
Reference in New Issue
Block a user