🚨 Over Receipt Validation Bypass in Purchase Receipt with Duplicate Item Rows

Hi Team,

I have noticed a critical issue in the Purchase Receipt workflow.

Steps to Reproduce:

  1. Create a Purchase Order with:
  • Item A, Qty = 10
  1. Create a Purchase Receipt against that PO:
  • Row 1: Item A, Qty = 10 (valid)
  • Row 2: Item A, Qty = 100 (duplicate item row)
  1. Submit the Purchase Receipt.

Issue:

  • The system allows submission.
  • The final Purchase Receipt Qty = 110, while the Purchase Order Qty = 10.
  • “Allow Over Receipt” checkbox is not enabled.

Expected Behavior:

  • System should consolidate all rows of the same item linked to the same PO and validate against the ordered quantity.
  • If total received > ordered qty (and no tolerance/over receipt allowance is given), submission should be blocked.

Did you found solution for this?

Hi @Rahul7218

Client Script may help

frappe.ui.form.on(‘Purchase Receipt’, {
refresh: function(frm) {
// Disable adding new rows in the items table
frm.fields_dict[‘items’].grid.cannot_add_rows = true;
frm.fields_dict[‘items’].grid.refresh();
}
});