Description
Hi Everyone,
I am working on an ERPNext customization where each Sales Order Item has the following custom fields:
-
Weight per Unit
-
Weight UOM
-
Total Weight (calculated automatically)
By default, ERPNext calculates:
Amount = Qty × Rate
My requirement is different.
If the item is sold based on weight, I want ERPNext to calculate:
Amount = Total Weight × Rate
instead of the standard Qty × Rate calculation.
The custom calculation works, but ERPNext’s standard calculate_taxes_and_totals() recalculates the amount and overwrites the custom value.
My questions are:
-
Is there a standard ERPNext/Frappe way to calculate the Amount using Total Weight instead of Quantity?
-
Does ERPNext provide any built-in feature or configuration to support weight-based pricing, or is custom development required?
-
Has anyone implemented a similar weight-based pricing workflow?
-
What is the recommended approach to avoid conflicts with the standard amount calculation (
calculate_taxes_and_totals())?
Any suggestions, best practices, or references to existing ERPNext implementations would be greatly appreciated.
Thank you!
