Hello everyone,
I am currently facing a challenge in ERPNext related to managing multiple business verticals with distinct workflows, and I am looking for guidance on the best practices to handle this scenario within the Frappe Framework.
Problem Statement
Business Structure Complexity
Our business operates with multiple verticals, each having its own requirements for transaction management. For example, We have four distinct invoice series representing different business verticals: A, B, C, and D. Each series requires entirely different fields, formats, approval workflows, and business logic. This necessitates separate handling and customization for each series within ERPNext.
Document Flows
Each series follows a different workflow. For example:
A Series: Sales Order → Delivery Note → Sales Invoice
B & C Series: Sales Order → Sales Invoice
D Series: Sales Order → Sales Invoice (or another unique flow)
The variation in workflows adds complexity and makes it difficult to manage the series within the system using standard DocTypes.
Cross-Document Series Mapping
To maintain consistency, each series is replicated across multiple DocTypes such as Lead, Quotation, Sales Order, Sales Invoice, and Delivery Note. For instance, a Lead created under series A should automatically transition to series A’s Sales Order, then to series A’s Delivery Note, and finally to series A’s Sales Invoice. The objective is to ensure that the flow remains consistent within a specific series across various DocTypes.
Current Implementation Method
We have implemented this by using ERPNext’s default DocTypes with extensive use of custom scripts to enforce the desired behavior for each series. These scripts handle series-specific logic, validation, field visibility, workflow transitions, and data processing. While this approach works, it introduces significant complexity.
Challenges and Maintenance Overhead
The existing approach has resulted in a large number of variables that our developers must manage. Having custom scripts applied across multiple DocTypes for each series creates a high maintenance burden. Keeping the scripts synchronized and ensuring consistency across series is proving to be a major challenge, making the system difficult to scale and prone to errors.
So I wanted to know that whether any other standardized and scalable approach within the Frappe Framework to handle multiple business verticals with distinct workflows. Ideally, I want to minimize custom scripts by using a mechanism that allows multiple DocTypes for each series, with the ability to inherit properties from parent DocTypes like Sales Orders, Sales Invoices, and Delivery Notes.
I would love to know how others have solved similar challenges. Is there a standard or recommended method within the Frappe Framework for handling such complex workflows? Can this be achieved by creating custom DocTypes that inherit properties from parent DocTypes while allowing series-specific customization?