I added a inspection template in operations but while completing the job card it’s not showing up for compulsory inspection. Is there any other way to set it or its just a name sake field?
The Inspection Template in the Operation is not mandatory by default in the Job Card. It’s just a reference field.
If you want to make Quality Inspection mandatory while completing a Job Card, you will need to write a Server Script.
You can use the following example script to enforce this:
qc_applicable = frappe.db.get_value(“Operation”, doc.operation, “quality_inspection_template”)
if qc_applicable:
approved_qc = frappe.db.get_value(
“Quality Inspection”,
{
“reference_type”: “Job Card”,
“reference_name”: doc.name,
“item_code”: doc.production_item,
“docstatus”: 1,
},
“name”,
)
if not approved_qc:
frappe.throw(_("Quality Inspection is mandatory to submit this Job Card"))
1 Like
I do not think any scripting is required! Check ERPNext settings in Stock and Manufacturing!