ERPNext Validation to Restrict Quantity Exceeding Sales Order Across Pick List, Delivery Note & Sales Invoice

Job ID: 40167837

Budget: ₹1,500 – ₹12,500 INR

We are looking for an experienced ERPNext / Frappe developer to implement strict quantity validation and linkage control across Sales Order → Pick List → Delivery Note → Sales Invoice.
Currently, ERPNext allows users to:


Add items from other Sales Orders into a Pick List


Enter quantity greater than the Sales Order in Pick List and Delivery Note


Create Sales Invoices with quantities exceeding linked Delivery Notes or Sales Orders


This leads to stock mismatch, incorrect dispatch, and billing inconsistencies.
The goal of this project is to enforce end-to-end quantity discipline while still allowing flexibility when documents are not linked to any Sales Order or Delivery Note.

Current Issues


Pick List


Users can add items from other Sales Orders


Picked quantity can exceed Sales Order quantity




Delivery Note


Quantity can exceed linked Sales Order quantity


Users can manually add extra quantity even when linked




Sales Invoice


Quantity can exceed linked Delivery Note or Sales Order


Extra quantities can be added even when document is linked





Required Functional Scope
1️⃣ Pick List Validation


Restrict Pick List items only to the linked Sales Order


Prevent adding items from any other Sales Order


Validate that:


Picked Quantity ≤ Remaining Sales Order Quantity




Role-based override:


Only specific roles (e.g. Admin / Manager) can bypass validation if required


Other roles must strictly follow limits





2️⃣ Delivery Note Validation


If linked to a Sales Order:


Quantity must not exceed Sales Order remaining quantity




If linked to a Pick List:


Quantity must not exceed Picked Quantity




Prevent manual addition of extra quantity beyond allowed limits


Validation should work:


On item add


On quantity change


On save / submit





3️⃣ Sales Invoice Validation


If linked to Delivery Note:


Invoice quantity ≤ Delivery Note quantity




If linked directly to Sales Order:


Invoice quantity ≤ Sales Order remaining quantity




Completely block extra quantity entry when linked


Allow free quantity entry ONLY when:


Sales Invoice is not linked to any Sales Order


AND not linked to any Delivery Note





4️⃣ Validation Behavior


Clear, user-friendly error messages


Validation must run on:


Client-side (for instant feedback)


Server-side (for data integrity)




No impact on performance



Technical Requirements


ERPNext v14 / v15 compatible


Clean, maintainable code


Use of:


Server Scripts / Custom App (preferred based on best practice)


Role Permission checks




No core file modification


Must handle:


Partial deliveries


Multiple Pick Lists per Sales Order


Multiple Delivery Notes per Sales Order





Deliverables


Fully working validation logic


Role-based permission control


Tested across all scenarios


Documentation explaining:


Validation flow


Role override logic


How to maintain / extend in future





Required Skills


ERPNext / Frappe Framework


Strong understanding of:


Sales Order


Pick List


Delivery Note


Sales Invoice workflows




Python & JavaScript (Frappe client scripts)


Experience with stock & fulfillment logic in ERPNext



Preferred Experience


Prior ERPNext stock workflow customization


Experience with role-based validation


Understanding of real-world dispatch & invoicing processes



If you want, I can also:


Rewrite this shorter for Upwork


Convert it into technical task breakdown


Add estimated timelines


Or make a non-technical version for management approval

Is this conversation helpful so far?