fix: allow to make quality inspection after Purchase / Delivery

(cherry picked from commit fad1a32e63)
This commit is contained in:
Rohit Waghchaure
2025-04-28 13:27:57 +05:30
committed by Mergify
parent 2e6112f21b
commit e0cea49236

View File

@@ -1047,6 +1047,16 @@ 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.db.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)