Allow Multiple Quality Inspections for a Single Item in Purchase Receipt

Issue Title: Allow Multiple Quality Inspections for a Single Item in Purchase Receipt

Issue Type: Feature Request

ERPNext Version: 15


Description

Currently, in ERPNext version 15, once a Quality Inspection (QI) report is submitted for an item in a Purchase Receipt, it prevents the creation of additional QI reports for the same item. This limitation poses a challenge when multiple inspections are needed for the same item, especially when the total quantity received needs to be individually inspected in separate batches or serial numbers.

Proposed Solution

Allow the creation of multiple Quality Inspection reports for a single item in a Purchase Receipt until the total quantity is inspected. This feature would enhance the flexibility and accuracy of the quality control process, particularly for items managed with batches or serial numbers.

Steps to Implement

  1. Add a Custom Field in Purchase Receipt Item:
  • Field Name: inspections_completed
  • Field Type: Int
  • Purpose: Track the number of inspections completed for each item.
  1. Modify Quality Inspection Logic:
  • Allow the creation of multiple QI reports linked to a single item in a Purchase Receipt.
  • Ensure the system checks the inspections_completed against the total quantity received before allowing new QI report creation.
  1. Include Batch and Serial Number in Quality Inspection:
  • Ensure each Quality Inspection can specify the batch or serial number of the inspected items.
  1. Server Script for On Submit in Quality Inspection:
  • Increment the inspections_completed field in the related Purchase Receipt Item each time a QI report is saved.
purchase_receipt_item = frappe.get_doc('Purchase Receipt Item', {

'parent': doc.reference_name,

'item_code': doc.item_code

})

if purchase_receipt_item.inspections_completed >= purchase_receipt_item.qty:

frappe.throw('All quantities have already been inspected.')

purchase_receipt_item.inspections_completed += 1

purchase_receipt_item.save()

Benefits

  • Allows for more granular and accurate quality control processes.
  • Supports scenarios where individual items or batches need separate inspection reports.
  • Enhances the flexibility of the quality inspection process, particularly in industries requiring detailed inspections for each unit, batch, or serial number received.

Additional Information

  • This feature request aims to improve the standard workflow without requiring significant customization from users.
  • Feedback and suggestions from the community are welcome to refine the proposed solution further.
1 Like

Good evening - I have exactly this problem and am running
ERPNext: v15.29.3 (version-15)
Frappe Framework: v15.34.1 (version-15)

Has this feature been implemented yet?

Are the QI same template or may they be different? I guess this is a poor design to be included in the major branch.
If each batch needs to be inspected, include a checkbox on the Quality tab to create or check inspection for each batch involved. This already implies different purchase receipt lines, so I guess this calls for further scrunity on the use case.

The QIs should be the same template. Each item of a batch (line item) needs to have its own QI (sample size of 1).

We are in the process of developing this functionality, it is currently a work in progress.