Open ruthra-kumar opened 3 weeks ago
Maybe the logic used for making Trial Balance work with large memory footprint data, can work here too.
Maybe the logic used for making Trial Balance work with large memory footprint data, can work here too.
You mean the 'Account Closing Balance' feature?
For Purchase Order, there are some
Issue
The current implementation of budget validation needs some refactor. On large sites, Purchase Orders with 100 items timeout while submitting.
Bottlenecks
Unavoidable nested-loop
Purchase Order can have any number of Items 'I', each item can have any number of dimensions 'D', and each dimension can have budgets for different fiscal years 'B'.
This structure lends itself to be handled by nested-loop - (I x D x B), like so
Methods are too generic
validate_expense_against_budget()
is too generic. It implicitly handles individual GL Entries and 'Items' (from Purchase Order) passed as args.https://github.com/frappe/erpnext/blob/c7d692345253c8d464a1637fb56d3a3168ba2392/erpnext/accounts/doctype/budget/budget.py#L143