#59019·erpnext

Formula-Based / Non-Linear Material Calculation in BOMs (Crucial for Pharma & Process Manufacturing)

Author: danialradmehrCreated Sep 11, 2026Updated Sep 17, 2026
Labelsfeature-request
  1. Background & Context Hello Frappe/ERPNext Team! We have been heavily developing and customizing ERPNext for a pharmaceutical company. During our implementation, we encountered and resolved several industry-specific challenges locally. However, to contribute to the growth and maturity of ERPNext, we have decided to share these solutions as feature requests. We believe this specific feature will make ERPNext a powerhouse for Process Manufacturing (Pharma, Chemicals, F&B).

  2. Is your feature request related to a problem? Please describe: Currently, ERPNext handles Bill of Materials (BOM) scaling purely linearly. If a BOM is based on 1 Unit, and a Work Order is created for 100 Units, the system simply multiplies every raw material by 100.

While this works perfectly for discrete manufacturing (e.g., assembling chairs), it completely fails in high-precision and process manufacturing like Pharmaceuticals. In these industries, material consumption is not always strictly proportional to the output quantity due to yield factors, chemical reactions, setup materials, or dynamic batch scaling. Example: A base BOM for 1 unit might require 1 gram of Substance X. However, due to chemical formulation, producing a batch of 100 units might mathematically require 67 grams (not 100 grams).

Currently, to handle this in ERPNext, a company producing 50 different products with 10 different target batch sizes has to manually create and maintain 500 distinct BOMs. This is an administrative nightmare and highly error-prone.

  1. Describe the solution you'd like: We propose introducing a "Formula-Based Calculation System" at the BOM Item row level, functioning similarly to Excel column formulas.

Base Setup: The main BOM page remains based on a standard Quantity (e.g., 1 Unit).

Formula Field: Introduce a new field (e.g., Qty Calculation Formula) in the BOM Item table.

Dynamic Batch Evaluation: When a Work Order is generated and the target production quantity (Batch Size) is entered, the system should evaluate this formula to calculate the exact required material quantity for that specific row, rather than relying on a simple multiplier.

UI Suggestion: A secondary tab or view inside the BOM could be dedicated to defining these calculation rules and formulas for specific target batch sizes.

  1. Describe alternatives you've considered:

Maintaining Multiple BOMs: Creating a separate BOM for every possible Batch Size (e.g., 50 base products x 10 batch sizes = 500 BOMs). This makes BOM maintenance extremely difficult and inefficient.

Custom Client/Server Scripts: We have locally customized the Work Order generation to override material quantities based on custom data fields. However, bringing this natively into the BOM functionality would standardize process manufacturing within ERPNext.

  1. Business Impact / Additional Context: Implementing this feature will seamlessly bridge the gap between Discrete and Process manufacturing in ERPNext. It allows companies with highly sensitive BOMs to maintain just 50 base BOMs instead of 500, drastically reducing data entry, minimizing the risk of catastrophic manufacturing errors, and making ERPNext significantly more attractive to the pharmaceutical and chemical sectors.

We would be happy to discuss this further and help the community shape this feature!