1. Based on the calorie level of the customer, the system should internally map to one of the three size variants (Small, Medium, Large).
Answer:-
We’ve created three Product Bundles to represent the size variants:
- Item Bulk A - Small (20g)
- Item Bulk A - Medium (30g)
- Item Bulk A - Large (40g)
Each of these Product Bundles is internally linked to the main stock item Item Bulk A with the appropriate quantity.
To handle calorie-based mapping:
We can either use a custom intermediate Doctype (e.g., Customer Subscription or Calorie Profile) before Sales Order creation,
Or directly write a Server Script on the Sales Order that maps the calorie level to the correct Product Bundle and adds it to the SO.
Example logic for a Server Script:
calorie = doc.get("customer_calorie_preference")
if calorie:
if calorie < 250:
item_code = "Item Bulk A - Small" #service product bundle item 20g
elif 250 <= calorie < 350:
item_code = "Item Bulk A - Medium" #service product bundle item 30g
else:
item_code = "Item Bulk A - Large" #service product bundle item 40g
doc.items = []
doc.append("items", {
"item_code": item_code,
"qty": 1,
"uom": "Gram"
})
2. We should be able to calculate the total bulk quantity of Item A required by summing up all internal sizes (e.g., 10 smalls = 200g, 5 mediums = 150g, etc.).
Answer:-
We use Sales Orders (linked to the Product Bundles) to estimate the demand for each size.
Since each bundle links to a fixed quantity of Item Bulk A, we can use standard ERPNext reports (e.g., Sales Order Analysis or Work Order Summary) to sum total quantity of Item Bulk A required.
Example: 10 Small (20g) + 5 Medium (30g) → 200g + 150g = 350g of Item Bulk A to manufacture.
3. The bulk Item A is manufactured using raw materials X and Y via a Work Order.
Answer:- We can create a BOM for Item Bulk A, listing Raw Material X and Y as components. This BOM is used to create a Work Order and manufacture the bulk quantity based on the estimated demand.
4. After bulk production, we pack it into the required number of Small/Medium/Large units based on daily demand. ( should able to define the box quantities like a Product Bundle or something)
Answer:-
This depends on the business workflow:
a) Make to Order
-
Each Sales Order includes the correct Product Bundle (automatically selected using the calorie logic).
-
From the SO, we can generate Delivery Notes and Sales Invoices directly for the customer.
b) Make to Stock
-
We raise Material Requests based on daily packing requirements.
-
Then create Work Orders for converting bulk into required units (S/M/L).
-
This gives flexibility to pack as per batch demand.
ERPNext supports both workflows natively, depending on how you manage inventory and production planning.
5. Customer should only see Item A (no size info) on invoices, delivery, etc.
Answer:-
Although internally we track Small/Medium/Large, customers should only see “Item A” on Sales Invoices and Delivery Notes.
To achieve this:
We customize the Print Format to display a generic item name (Item A) and hide internal size info.
This ensures the customer always sees a clean and simple product label.
NOTE: Since I don’t use item variants in my case—as it totally depends on whether they are required or not—I felt it became much more complex. So, I used product bundles instead.